aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-18 00:32:01 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-18 00:32:01 +0000
commit3e22cb9ec30cd9b1be9b0f50e400f512124997e5 (patch)
treed91505c1c58284bc084beddbb3db5e371173f68b /lib/Transforms/InstCombine/InstCombineCalls.cpp
parent28b42afcb88b796008d7fc1b84b754191e9566fa (diff)
Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 83653fd6d5..08185f5b11 100644
--- a/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -835,7 +835,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
// If OldCall dues not return void then replaceAllUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!OldCall->getType()->isVoidTy())
- OldCall->replaceAllUsesWith(UndefValue::get(OldCall->getType()));
+ ReplaceInstUsesWith(*OldCall, UndefValue::get(OldCall->getType()));
if (isa<CallInst>(OldCall))
return EraseInstFromFunction(*OldCall);
@@ -857,8 +857,8 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
// If CS does not return void then replaceAllUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!CS.getInstruction()->getType()->isVoidTy())
- CS.getInstruction()->
- replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType()));
+ ReplaceInstUsesWith(*CS.getInstruction(),
+ UndefValue::get(CS.getInstruction()->getType()));
if (InvokeInst *II = dyn_cast<InvokeInst>(CS.getInstruction())) {
// Don't break the CFG, insert a dummy cond branch.
@@ -1145,8 +1145,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
}
if (!Caller->use_empty())
- Caller->replaceAllUsesWith(NV);
-
+ ReplaceInstUsesWith(*Caller, NV);
+
EraseInstFromFunction(*Caller);
return true;
}
@@ -1291,7 +1291,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
cast<CallInst>(NewCaller)->setAttributes(NewPAL);
}
if (!Caller->getType()->isVoidTy())
- Caller->replaceAllUsesWith(NewCaller);
+ ReplaceInstUsesWith(*Caller, NewCaller);
Caller->eraseFromParent();
Worklist.Remove(Caller);
return 0;