diff options
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index e025b053765..5e98d5b4750 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -287,7 +287,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { const Type *Tys[3] = { CI.getOperand(1)->getType(), CI.getOperand(2)->getType(), CI.getOperand(3)->getType() }; - CI.setOperand(0, + CI.setCalledFunction( Intrinsic::getDeclaration(M, MemCpyID, Tys, 3)); Changed = true; } @@ -526,7 +526,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { // X + 0 -> {X, false} if (RHS->isZero()) { Constant *V[] = { - UndefValue::get(II->getOperand(0)->getType()), + UndefValue::get(II->getCalledValue()->getType()), ConstantInt::getFalse(II->getContext()) }; Constant *Struct = ConstantStruct::get(II->getContext(), V, 2, false); |