[AArch64] Add early exit to promoteLoadFromStore.

There should be at most a single kill flag for the
promoted operand between the store/load pair.
Discussed in https://reviews.llvm.org/D34402.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305889 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Florian Hahn 2017-06-21 09:51:52 +00:00
parent 1f165906bb
commit 3b3d0f0cd3

View File

@ -877,7 +877,10 @@ AArch64LoadStoreOpt::promoteLoadFromStore(MachineBasicBlock::iterator LoadI,
// Clear kill flags between store and load.
for (MachineInstr &MI : make_range(StoreI->getIterator(),
BitExtMI->getIterator()))
MI.clearRegisterKills(StRt, TRI);
if (MI.killsRegister(StRt, TRI)) {
MI.clearRegisterKills(StRt, TRI);
break;
}
DEBUG(dbgs() << "Promoting load by replacing :\n ");
DEBUG(StoreI->print(dbgs()));