Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Aug 26, 2025

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

Copy link
Contributor Author

arsenm commented Aug 26, 2025

@llvmbot
Copy link
Member

llvmbot commented Aug 26, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

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

@arsenm arsenm requested review from Pierre-vh and Sisyph August 26, 2025 23:28
@arsenm arsenm marked this pull request as ready for review August 26, 2025 23:28
Copy link
Collaborator

@rampitec rampitec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since there are no test changes. Unless it fails testing.

@arsenm arsenm force-pushed the users/arsenm/amdgpu/remove-true16-rewrite-sgprlo16 branch from 37c07a5 to 1478053 Compare August 27, 2025 01:36
Base automatically changed from users/arsenm/amdgpu/fold-s-mov-imm-into-av-copy to main August 27, 2025 02:13
Previous change accidentally broke this which shows it's not
doing anything.
@arsenm arsenm force-pushed the users/arsenm/amdgpu/remove-true16-rewrite-sgprlo16 branch from 1478053 to 0e2ba58 Compare August 27, 2025 05:24
@arsenm arsenm enabled auto-merge (squash) August 27, 2025 05:24
@arsenm arsenm merged commit a0c472d into main Aug 27, 2025
9 checks passed
@arsenm arsenm deleted the users/arsenm/amdgpu/remove-true16-rewrite-sgprlo16 branch August 27, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants