[llvm] [AMDGPU] Prevent folding of FMAC into FMAAK with two literals (PR #217438)

Igor Wodiany via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 02:33:25 PDT 2026


================
@@ -4001,6 +4001,10 @@ bool SIInstrInfo::foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
       if (pseudoToMCOpcode(NewOpc) == -1)
         return false;
 
+      if ((Src0->isImm() && !isInlineConstant(*Src0)) ||
----------------
IgWod wrote:

Is `isLegalOperand` an existing function? If so I can't seem to find it. Or is your suggestion to create a new helper called `isLegalOperand`? If the latter, I don't see much benefit here. You end up with more lines of code than currently and I don't think such abstraction helps that much in understanding the code.

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


More information about the llvm-commits mailing list