Use Use::set rather than finding the operand number of the use

and setting that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2012-02-08 14:10:53 +00:00
parent 80fd2a1972
commit 8c160548ce

View File

@ -1900,12 +1900,9 @@ unsigned GVN::replaceAllDominatedUsesWith(Value *From, Value *To,
unsigned Count = 0;
for (Value::use_iterator UI = From->use_begin(), UE = From->use_end();
UI != UE; ) {
Instruction *User = cast<Instruction>(*UI);
unsigned OpNum = UI.getOperandNo();
++UI;
if (DT->dominates(Root, User->getParent())) {
User->setOperand(OpNum, To);
Use &U = (UI++).getUse();
if (DT->dominates(Root, cast<Instruction>(U.getUser())->getParent())) {
U.set(To);
++Count;
}
}