[llvm] [GlobalISel] Allow some load/store instructions to be folded in Match Table backend (PR #70830)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 19:27:06 PDT 2023


================
@@ -70,6 +70,25 @@ bool GIMatchTableExecutor::isObviouslySafeToFold(MachineInstr &MI,
   if (MI.isConvergent() && MI.getParent() != IntoMI.getParent())
     return false;
 
-  return !MI.mayLoadOrStore() && !MI.mayRaiseFPException() &&
-         !MI.hasUnmodeledSideEffects() && MI.implicit_operands().empty();
+  auto IsSafe = [](const MachineInstr &MI) {
+    return !MI.mayRaiseFPException() && !MI.hasUnmodeledSideEffects() &&
+           MI.implicit_operands().empty();
----------------
arsenm wrote:

Don't understand the implicit operands check. I think this is starting to reproduce MachineInstr::isSafeToMove

https://github.com/llvm/llvm-project/pull/70830


More information about the llvm-commits mailing list