mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Add a minor optimization: if we haven't changed the operands of an
add, there is no need to scan the world to find the same add again. This invalidates the previous testcase, which wasn't wonderful anyway, because it needed a run of instcombine to permute the use-lists in just the right way to before GVN was run (so it was really fragile). Not a big loss. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -275,6 +275,10 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
|
||||
RemoveInstInputs(LHS, InstInputs);
|
||||
return AddAsInput(Res);
|
||||
}
|
||||
|
||||
// If we didn't modify the add, just return it.
|
||||
if (LHS == Inst->getOperand(0) && RHS == Inst->getOperand(1))
|
||||
return Inst;
|
||||
|
||||
// Otherwise, see if we have this add available somewhere.
|
||||
for (Value::use_iterator UI = LHS->use_begin(), E = LHS->use_end();
|
||||
|
Reference in New Issue
Block a user