Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU] Add isAsCheapAsAMove for v_pk_mov_b32 #127632

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

shiltian
Copy link
Contributor

@shiltian shiltian commented Feb 18, 2025

Co-authored-by: Matt Arsenault [email protected]

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Feb 18, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

Changes

Credit: @arsenm


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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/VOP3PInstructions.td (+1-1)
diff --git a/llvm/lib/Target/AMDGPU/VOP3PInstructions.td b/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
index 21898da1912f5..d5c6e8af109f4 100644
--- a/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP3PInstructions.td
@@ -1151,7 +1151,7 @@ let isCommutable = 1, isReMaterializable = 1 in {
     defm V_PK_ADD_F32 : VOP3PInst<"v_pk_add_f32", VOP3P_Profile<VOP_V2F32_V2F32_V2F32, VOP3_PACKED>, any_fadd>;
   } // End SubtargetPredicate = HasPackedFP32Ops
 
-  let SubtargetPredicate = HasPkMovB32 in
+  let SubtargetPredicate = HasPkMovB32, isAsCheapAsAMove = 1 in
   defm V_PK_MOV_B32 : VOP3PInst<"v_pk_mov_b32", VOP3P_Profile<VOP_V2I32_V2I32_V2I32, VOP3_PACKED>>;
 } // End isCommutable = 1, isReMaterializable = 1
 

@arsenm
Copy link
Contributor

arsenm commented Feb 18, 2025

Best bet is likely a rematerialize test. e.g. add a case to remat-vop.mir that needs to handle v_pk_mov_b32. One in the coalescer might be better, like llvm/test/CodeGen/AMDGPU/vgpr-remat.mir

@shiltian shiltian force-pushed the users/shiltian/add-isAsCheapAsAMove-for-v_pk_mov_b32 branch from 1e3b907 to 95f6847 Compare February 18, 2025 23:16
@shiltian shiltian marked this pull request as ready for review February 18, 2025 23:17
@shiltian
Copy link
Contributor Author

For some reason, Graphite can't retarget this PR. It is supposed to be on top of #127715.

@shiltian shiltian force-pushed the users/shiltian/add-isAsCheapAsAMove-for-v_pk_mov_b32 branch from 95f6847 to 4c23ee1 Compare February 18, 2025 23:18
@shiltian shiltian force-pushed the users/shiltian/add-isAsCheapAsAMove-for-v_pk_mov_b32 branch from 4c23ee1 to 85f3c4d Compare February 19, 2025 04:43
@shiltian shiltian merged commit a44284c into main Feb 19, 2025
8 checks passed
@shiltian shiltian deleted the users/shiltian/add-isAsCheapAsAMove-for-v_pk_mov_b32 branch February 19, 2025 05:51
Prakhar-Dixit pushed a commit to Prakhar-Dixit/llvm-project that referenced this pull request Feb 19, 2025
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.

3 participants