mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 05:12:20 +00:00
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:
parent
80fd2a1972
commit
8c160548ce
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user