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

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 26 16:28:44 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/155518.diff


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/SIFoldOperands.cpp (-8) 


``````````diff
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 :

``````````

</details>


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


More information about the llvm-branch-commits mailing list