diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-12-01 21:29:16 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-12-01 21:29:16 +0000 |
commit | 00737bdb488cc7157ca5f7a40d6cd8467ad09a79 (patch) | |
tree | 199217b2a1df12c286d4c329642c7fcf6070f33f /lib/Transforms/InstCombine/InstCombineCasts.cpp | |
parent | dc81e5da271ed394e2029c83458773c4ae2fc5f4 (diff) | |
download | external_llvm-00737bdb488cc7157ca5f7a40d6cd8467ad09a79.zip external_llvm-00737bdb488cc7157ca5f7a40d6cd8467ad09a79.tar.gz external_llvm-00737bdb488cc7157ca5f7a40d6cd8467ad09a79.tar.bz2 |
Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetData
where it appeared beneficial to pass.
More of rdar://10500969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCasts.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp index c78f6cd..46e4acd 100644 --- a/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -148,8 +148,6 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI, return ReplaceInstUsesWith(CI, New); } - - /// EvaluateInDifferentType - Given an expression that /// CanEvaluateTruncated or CanEvaluateSExtd returns true for, actually /// insert the code to evaluate the expression. @@ -159,7 +157,7 @@ Value *InstCombiner::EvaluateInDifferentType(Value *V, Type *Ty, C = ConstantExpr::getIntegerCast(C, Ty, isSigned /*Sext or ZExt*/); // If we got a constantexpr back, try to simplify it with TD info. if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) - C = ConstantFoldConstantExpression(CE, TD); + C = ConstantFoldConstantExpression(CE, TD, TLI); return C; } @@ -1212,10 +1210,9 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) { } // Fold (fptrunc (sqrt (fpext x))) -> (sqrtf x) - const TargetLibraryInfo &TLI = getAnalysis<TargetLibraryInfo>(); CallInst *Call = dyn_cast<CallInst>(CI.getOperand(0)); - if (Call && Call->getCalledFunction() && TLI.has(LibFunc::sqrtf) && - Call->getCalledFunction()->getName() == TLI.getName(LibFunc::sqrt) && + if (Call && Call->getCalledFunction() && TLI->has(LibFunc::sqrtf) && + Call->getCalledFunction()->getName() == TLI->getName(LibFunc::sqrt) && Call->getNumArgOperands() == 1 && Call->hasOneUse()) { CastInst *Arg = dyn_cast<CastInst>(Call->getArgOperand(0)); |