[llvm] r305889 - [AArch64] Add early exit to promoteLoadFromStore.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 02:51:53 PDT 2017
Author: fhahn
Date: Wed Jun 21 04:51:52 2017
New Revision: 305889
URL: http://llvm.org/viewvc/llvm-project?rev=305889&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp?rev=305889&r1=305888&r2=305889&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp Wed Jun 21 04:51:52 2017
@@ -877,7 +877,10 @@ AArch64LoadStoreOpt::promoteLoadFromStor
// 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()));
More information about the llvm-commits
mailing list