[llvm] a0c472d - AMDGPU: Remove special case of SGPR_LO class in imm folding (#155518)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 23:08:42 PDT 2025


Author: Matt Arsenault
Date: 2025-08-27T06:08:38Z
New Revision: a0c472d50f29d47223d3fc362ae11d9bff966dac

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

LOG: AMDGPU: Remove special case of SGPR_LO class in imm folding (#155518)

Previous change accidentally broke this which shows it's not
doing anything.

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 e1bc6d0239111..3979e1e0c44aa 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -1260,14 +1260,6 @@ void SIFoldOperandsImpl::foldOperand(
       return;
 
     const TargetRegisterClass *DestRC = TRI->getRegClassForReg(*MRI, DestReg);
-    // Allow immediates COPYd into sgpr_lo16 to be further folded while
-    // still being legal if not further folded
-    if (DestRC == &AMDGPU::SGPR_LO16RegClass) {
-      assert(ST->useRealTrue16Insts());
-      MRI->setRegClass(DestReg, &AMDGPU::SGPR_32RegClass);
-      DestRC = &AMDGPU::SGPR_32RegClass;
-    }
-
     // In order to fold immediates into copies, we need to change the copy to a
     // MOV. Find a compatible mov instruction with the value.
     for (unsigned MovOp :


        


More information about the llvm-commits mailing list