[llvm] 1b07c58 - AMDGPU: Delete seemingly dead s_fmaak_f32/s_fmamk_f32 folding code (#140580)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 10:36:08 PDT 2025


Author: Matt Arsenault
Date: 2025-05-29T19:36:05+02:00
New Revision: 1b07c589b245d078e00576bbd00436cc7f53a7c6

URL: https://github.com/llvm/llvm-project/commit/1b07c589b245d078e00576bbd00436cc7f53a7c6
DIFF: https://github.com/llvm/llvm-project/commit/1b07c589b245d078e00576bbd00436cc7f53a7c6.diff

LOG: AMDGPU: Delete seemingly dead s_fmaak_f32/s_fmamk_f32 folding code (#140580)

No tests fail with this. I'm not sure I understand the comment,
there can't be any folding into an operand that had to already
be a constant. I tried different combinations of immediates to these
instructions but never hit the condition.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 26167134652ce..c45611582a53a 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -766,17 +766,6 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
     return true;
   }
 
-  // Inlineable constant might have been folded into Imm operand of fmaak or
-  // fmamk and we are trying to fold a non-inlinable constant.
-  if ((Opc == AMDGPU::S_FMAAK_F32 || Opc == AMDGPU::S_FMAMK_F32) &&
-      !OpToFold->isReg() && !TII->isInlineConstant(*OpToFold)) {
-    unsigned ImmIdx = Opc == AMDGPU::S_FMAAK_F32 ? 3 : 2;
-    MachineOperand &OpImm = MI->getOperand(ImmIdx);
-    if (!OpImm.isReg() &&
-        TII->isInlineConstant(*MI, MI->getOperand(OpNo), OpImm))
-      return tryToFoldAsFMAAKorMK();
-  }
-
   // Special case for s_fmac_f32 if we are trying to fold into Src0 or Src1.
   // By changing into fmamk we can untie Src2.
   // If folding for Src0 happens first and it is identical operand to Src1 we


        


More information about the llvm-commits mailing list