diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Evaluator.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 39d294f8602..e75a5dbddba 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1243,7 +1243,7 @@ CallOverdefined: // Otherwise, if we have a single return value case, and if the function is // a declaration, maybe we can constant fold it. if (F && F->isDeclaration() && !I->getType()->isStructTy() && - canConstantFoldCallTo(CS, F)) { + canConstantFoldCallTo(cast<CallBase>(CS.getInstruction()), F)) { SmallVector<Constant*, 8> Operands; for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { @@ -1264,7 +1264,8 @@ CallOverdefined: // If we can constant fold this, mark the result of the call as a // constant. - if (Constant *C = ConstantFoldCall(CS, F, Operands, TLI)) { + if (Constant *C = ConstantFoldCall(cast<CallBase>(CS.getInstruction()), F, + Operands, TLI)) { // call -> undef. if (isa<UndefValue>(C)) return; diff --git a/llvm/lib/Transforms/Utils/Evaluator.cpp b/llvm/lib/Transforms/Utils/Evaluator.cpp index 4a8ec438c28..fb8cb3ddea6 100644 --- a/llvm/lib/Transforms/Utils/Evaluator.cpp +++ b/llvm/lib/Transforms/Utils/Evaluator.cpp @@ -540,7 +540,8 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst, if (Callee->isDeclaration()) { // If this is a function we can constant fold, do it. - if (Constant *C = ConstantFoldCall(CS, Callee, Formals, TLI)) { + if (Constant *C = ConstantFoldCall(cast<CallBase>(CS.getInstruction()), + Callee, Formals, TLI)) { InstResult = castCallResultIfNeeded(CS.getCalledValue(), C); if (!InstResult) return false; diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b7e69669839..f10bc6520a8 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -415,8 +415,8 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I, if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0))) return C->isNullValue() || isa<UndefValue>(C); - if (CallSite CS = CallSite(I)) - if (isMathLibCallNoop(CS, TLI)) + if (auto *Call = dyn_cast<CallBase>(I)) + if (isMathLibCallNoop(Call, TLI)) return true; return false; |