[llvm] [AArch64][GlobalISel] Add support for pre-indexed loads/stores. (PR #70185)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 04:14:09 PDT 2023
================
@@ -1141,11 +1141,28 @@ bool CombinerHelper::findPreIndexCandidate(GLoadStore &LdSt, Register &Addr,
return false;
}
+ // Avoid increasing cross-block register pressure.
+ for (auto &AddrUse : MRI.use_nodbg_instructions(Addr))
+ if (AddrUse.getParent() != LdSt.getParent())
+ return false;
+
// FIXME: check whether all uses of the base pointer are constant PtrAdds.
// That might allow us to end base's liveness here by adjusting the constant.
-
- return all_of(MRI.use_nodbg_instructions(Addr),
- [&](MachineInstr &UseMI) { return dominates(LdSt, UseMI); });
+ bool RealUse = false;
+ for (auto &AddrUse : MRI.use_nodbg_instructions(Addr)) {
+ if (!dominates(LdSt, AddrUse))
----------------
arsenm wrote:
Defer the dominance check until after you know the mode is foldable?
https://github.com/llvm/llvm-project/pull/70185
More information about the llvm-commits
mailing list