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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 12:53:18 PDT 2026


================
@@ -3963,6 +3963,9 @@ bool SIInstrInfo::foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
 
     // Added part is the constant: Use v_madak_{f16, f32}.
     if (Src2->isReg() && Src2->getReg() == Reg) {
+      if ((Src0->isImm() && !isInlineConstant(*Src0)) ||
----------------
arsenm wrote:

This seems like it should be evaluated somewhere lower, preferably by checking isInlineConstant in the context of the exact instructions operands rather than just the contextless value 

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


More information about the llvm-commits mailing list