This is an archive of the discontinued LLVM Phabricator instance.

[CGP] Cleanup - remove redundant code in OptimizeMemoryInst. NFC
ClosedPublic

Authored by skatkov on Jul 11 2017, 10:45 PM.

Details

Summary

optimizeMemoryInst contains a vector AddrModeInsts.

The only use of this vector is to check that all instructions are in the same block as memory instruction.
This check is guarded by PhiSeen flag, so if we traversed through phi node then we do not need to keep information in AddrModeInsts.
AddModeInsts is set first time we found some addressing mode and updated if we found new one later.
We can find next addressing mode only if we traverse phi node so all code related to update of AddModeInsts can be safely removed.

Diff Detail

Repository
rL LLVM

Event Timeline

skatkov created this revision.Jul 11 2017, 10:45 PM
This revision is now accepted and ready to land.Jul 17 2017, 12:53 PM
This revision was automatically updated to reflect the committed changes.