diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 10:27:02 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 10:27:02 +0000 |
commit | 37cd6cfba2e92fa89fbc4e8653edf1bb3229ba0d (patch) | |
tree | e6823002829472937c12857c88104b02b2d3b7a3 /llvm/lib/Analysis/TargetTransformInfo.cpp | |
parent | 1f1b2756a467b8ab835109c4aae6a4e84cbd64c3 (diff) | |
download | bcm5719-llvm-37cd6cfba2e92fa89fbc4e8653edf1bb3229ba0d.tar.gz bcm5719-llvm-37cd6cfba2e92fa89fbc4e8653edf1bb3229ba0d.zip |
Turn MipsOptimizeMathLibCalls into a target-independent scalar transform
...so that it can be used for z too. Most of the code is the same.
The only real change is to use TargetTransformInfo to test when a sqrt
instruction is available.
The pass is opt-in because at the moment it only handles sqrt.
llvm-svn: 189097
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/TargetTransformInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index 4ad71627bea..0a215aa53c6 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -145,6 +145,10 @@ TargetTransformInfo::getPopcntSupport(unsigned IntTyWidthInBit) const { return PrevTTI->getPopcntSupport(IntTyWidthInBit); } +bool TargetTransformInfo::haveFastSqrt(Type *Ty) const { + return PrevTTI->haveFastSqrt(Ty); +} + unsigned TargetTransformInfo::getIntImmCost(const APInt &Imm, Type *Ty) const { return PrevTTI->getIntImmCost(Imm, Ty); } @@ -505,6 +509,10 @@ struct NoTTI : ImmutablePass, TargetTransformInfo { return PSK_Software; } + bool haveFastSqrt(Type *Ty) const { + return false; + } + unsigned getIntImmCost(const APInt &Imm, Type *Ty) const { return 1; } |