[llvm] [AArch64] merge index address with large offset into base address (PR #75343)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 02:21:36 PST 2023
================
@@ -2220,6 +2395,60 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
return E;
}
+MachineBasicBlock::iterator
+AArch64LoadStoreOpt::findMatchingConstOffsetBackward(
+ MachineBasicBlock::iterator I, unsigned Limit, unsigned &Offset) {
+ MachineBasicBlock::iterator B = I->getParent()->begin();
+ MachineBasicBlock::iterator E = I->getParent()->end();
+ MachineInstr &MemMI = *I;
+ MachineBasicBlock::iterator MBBI = I;
+
+ // If the load is the first instruction in the block, there's obviously
+ // not any matching load or store.
+ if (MBBI == B)
+ return E;
+
+ // Make sure the IndexReg is killed and the shift amount is zero.
+ // TODO: Relex this restriction to extend, simplify processing now.
+ if (!AArch64InstrInfo::getLdStOffsetOp(MemMI).isKill() ||
----------------
davemgreen wrote:
Is this essentially a one-use check on the MOV reg?
https://github.com/llvm/llvm-project/pull/75343
More information about the llvm-commits
mailing list