[llvm] [AMDGPU] Do not fold an immediate into instructions with frame indexes (PR #151263)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 23:57:53 PDT 2025


================
@@ -6120,10 +6120,11 @@ bool SIInstrInfo::isOperandLegal(const MachineInstr &MI, unsigned OpIdx,
           !Op.isIdenticalTo(*MO))
         return false;
 
-      // Do not fold a frame index into an instruction that already has a frame
-      // index. The frame index handling code doesn't handle fixing up operand
-      // constraints if there are multiple indexes.
-      if (Op.isFI() && MO->isFI())
+      // Do not fold a non-inlineable and non-register operand into an
+      // instruction that already has a frame index. The frame index handling
+      // code could not handle well when a fame index co-exists with another
----------------
arsenm wrote:

```suggestion
      // code could not handle well when a frame index co-exists with another
```

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


More information about the llvm-commits mailing list