summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb9ed18f2cb9df4c14feecb574fbffff9ce75644a (patch)
treebefede0242d913accf2798520f31d657a68112f3 /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
parent7d7ad8374f19298832da821a44b85f2d92716e79 (diff)
downloadbcm5719-llvm-b9ed18f2cb9df4c14feecb574fbffff9ce75644a.tar.gz
bcm5719-llvm-b9ed18f2cb9df4c14feecb574fbffff9ce75644a.zip
Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.
llvm-svn: 131512
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 83653fd6d5b..08185f5b11f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud