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
This commit is contained in:
Eli Friedman
2011-05-18 00:32:01 +00:00
parent 28b42afcb8
commit 3e22cb9ec3
3 changed files with 11 additions and 11 deletions

View File

@ -133,7 +133,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
// New is the allocation instruction, pointer typed. AI is the original
// allocation instruction, also pointer typed. Thus, cast to use is BitCast.
Value *NewCast = AllocaBuilder.CreateBitCast(New, AI.getType(), "tmpcast");
AI.replaceAllUsesWith(NewCast);
ReplaceInstUsesWith(AI, NewCast);
}
return ReplaceInstUsesWith(CI, New);
}
@ -1228,7 +1228,7 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
// Remove the old Call. With -fmath-errno, it won't get marked readnone.
Call->replaceAllUsesWith(UndefValue::get(Call->getType()));
ReplaceInstUsesWith(*Call, UndefValue::get(Call->getType()));
EraseInstFromFunction(*Call);
return ret;
}