-
Notifications
You must be signed in to change notification settings - Fork 14.9k
AMDGPU: Add missing verifier tests for load/store AGPR case #155815
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
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/amdgpu/add-test-verify-load-store-match-agpr-vgpr
Aug 28, 2025
Merged
AMDGPU: Add missing verifier tests for load/store AGPR case #155815
arsenm
merged 1 commit into
main
from
users/arsenm/amdgpu/add-test-verify-load-store-match-agpr-vgpr
Aug 28, 2025
+92
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/155815.diff 1 Files Affected:
diff --git a/llvm/test/MachineVerifier/AMDGPU/verify-ds-vdata-vdst-both-agpr-or-vgpr.mir b/llvm/test/MachineVerifier/AMDGPU/verify-ds-vdata-vdst-both-agpr-or-vgpr.mir
new file mode 100644
index 0000000000000..956a8b80e4082
--- /dev/null
+++ b/llvm/test/MachineVerifier/AMDGPU/verify-ds-vdata-vdst-both-agpr-or-vgpr.mir
@@ -0,0 +1,92 @@
+# RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -run-pass=none -filetype=null %s 2>&1 | FileCheck -implicit-check-not=Bad %s
+
+---
+name: invalid_mixed_agpr_vgpr_ops_ds_atomic
+tracksRegLiveness: true
+body: |
+ bb.0:
+
+ %addr:vgpr_32 = IMPLICIT_DEF
+ %vgpr:vgpr_32 = IMPLICIT_DEF
+ %agpr:agpr_32 = IMPLICIT_DEF
+ %a_or_v:av_32 = IMPLICIT_DEF
+
+ ; CHECK: Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %4:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %5:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %6:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %7:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %8:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %vgpr, %a_or_v, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %9:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %vgpr, %vgpr, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %10:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %11:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %12:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %13:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ %14:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %a_or_v, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %agpr, %vgpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %vgpr, %agpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %vgpr, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %a_or_v, %vgpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %agpr, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+ ; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ ; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
+ DS_WRITE2_B32_gfx9 %addr, %a_or_v, %agpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
+
+...
|
Pierre-vh
approved these changes
Aug 28, 2025
t-a-james
pushed a commit
to t-a-james/llvm-project
that referenced
this pull request
Aug 28, 2025
…oject into bugprone-method-hiding * 'bugprone-method-hiding' of github.com:t-a-james/llvm-project: (230 commits) [SimplifyCFG] Move token type check into canReplaceOperandWithVariable() [ADT] Fix signed integer overflow (llvm#155826) [Offload] Update LIBOMPTARGET_INFO text for `attach` map-type. (llvm#155509) [CMake][AIX] Enable CMP0182: Create shared library archives by default (llvm#155686) AMDGPU: Add tests for atomics with AGPR operands (llvm#155820) [AArch64] Split zero cycle zeoring per register class (llvm#154561) [gn build] Port fa883e1 [mlir][tosa] Allow shift operand of tosa::MulOp as non-constant (llvm#155197) [AArch64][NFC] Add MCInstrAnalysis unittests (llvm#155609) [Offload][OpenMP] Tests require libc on GPU for printf (llvm#155785) AMDGPU: Add missing verifier tests for load/store AGPR case (llvm#155815) [lldb-mcp] Fix building for Windows Revert "[lldb] Correct a usage after a rename was merged. (llvm#155720)" Revert "[lldb] NFC Moving mcp::Transport into its own file. (llvm#155711)" [lldb][test] Run ranges::ref_vew test only for libc++ (llvm#155813) [SCCP][FuncSpec] Poison unreachable constant global variable user (llvm#155753) [LoongArch] Lowering v32i8 vector mask generation to `VMSKLTZ` (llvm#149953) [flang][docs][NFC] Remove stray backtick (llvm#154974) [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in LinalgOps.cpp (NFC) [MLIR] Apply clang-tidy fixes for performance-move-const-arg in VariantValue.cpp (NFC) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.