-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AMDGPU][NFC] Added test for live-in CSR SGPR used partially giving MachineVerifier error #126696
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][NFC] Added test for live-in CSR SGPR used partially giving MachineVerifier error #126696
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Vikash Gupta (vg0204) ChangesFull diff: https://github.com/llvm/llvm-project/pull/126696.diff 1 Files Affected:
diff --git a/llvm/test/CodeGen/AMDGPU/spill-partial-csr-sgpr-live-ins.mir b/llvm/test/CodeGen/AMDGPU/spill-partial-csr-sgpr-live-ins.mir
new file mode 100644
index 00000000000000..8ed88339d59181
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/spill-partial-csr-sgpr-live-ins.mir
@@ -0,0 +1,52 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -run-pass=si-lower-sgpr-spills -o - %s | FileCheck %s
+# XFAIL: *
+
+# FIXME : Currently, MRI's liveIn check for regiters does not take corresponding live-in's sub-registers in account. As a result
+# in SILowerSGPRSpills, the SubReg spill gets marked KILLED eventhough its SuperReg is in function Live-ins. This causes machine
+# verifier to now fail at direct usage of that SubReg, which intially should not be any problem before adding spill.
+
+# CHECK: *** Bad machine code: Using an undefined physical register ***
+
+---
+name: spill_partial_live_csr_sgpr_argument_test_1
+tracksRegLiveness: true
+liveins:
+ - { reg: '$sgpr50_sgpr51' }
+body: |
+ bb.0:
+ liveins: $sgpr50_sgpr51
+
+ S_NOP 0, implicit $sgpr50
+ $sgpr50 = S_MOV_B32 0
+
+...
+
+---
+name: spill_partial_live_csr_sgpr_argument_test_2
+tracksRegLiveness: true
+liveins:
+ - { reg: '$sgpr50_sgpr51' }
+body: |
+ bb.0:
+ liveins: $sgpr50_sgpr51
+
+ S_NOP 0, implicit $sgpr50
+ $sgpr50_sgpr51 = S_MOV_B64 0
+
+...
+
+---
+name: spill_partial_live_csr_sgpr_argument_test_3
+tracksRegLiveness: true
+liveins:
+ - { reg: '$sgpr52_sgpr53' }
+body: |
+ bb.0:
+ liveins: $sgpr52_sgpr53
+
+ S_NOP 0, implicit $sgpr53
+ $sgpr52_sgpr53 = S_MOV_B64 0
+ $sgpr54 = S_MOV_B32 0
+
+...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
liveins: | ||
- { reg: '$sgpr50_sgpr51' } | ||
- { reg: '$sgpr52_sgpr53' } | ||
- { reg: '$sgpr54_sgpr55' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should drop the function live ins part. I don't believe it should be required for any liveness functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for MRI's livein check as done in SILowerSGPRSpills.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SILowerSGPRSpills should not be depending on this information, and it is not being used in this test
Can you stack the PR #126926 along with it? This PR is supposed to fix the error you mentioned in this test. We should be able to see how the proposed fix changes the test if they are stacked together. |
In order to stack PRs (assuming graphite), don't we need to create new PRs completely for test & patch as both of these branches as for now are independent & created from my forked repo's main. I am thinking for this time to merge it in upstream & rebase it for the patch PR, that might do the trick for now. Will take care of stacking in such future cases! |
e7aaf4a
to
d1e3339
Compare
[AMD Official Use Only - AMD Internal Distribution Only]
Following stack might help you understand the workflow:
✅ #128648 AMDGPU: Handle demanded subvectors for readfirstlane<https://app.graphite.dev//github/pr/llvm/llvm-project/128648?ref=gt-pasteable-stack> +68/-30
✅ #128647 AMDGPU: Reduce readfirstlane for single demanded vector element<https://app.graphite.dev//github/pr/llvm/llvm-project/128647?ref=gt-pasteable-stack> +78/-31
✅ #128646 AMDGPU: Simplify demanded vector elts of readfirstlane sources<https://app.graphite.dev//github/pr/llvm/llvm-project/128646?ref=gt-pasteable-stack> +7/-8
✅ #128645 AMDGPU: Add baseline tests for simplify elts of readfirstlane<https://app.graphite.dev//github/pr/llvm/llvm-project/128645?ref=gt-pasteable-stack> +444/-0
…________________________________
From: Vikash Gupta ***@***.***>
Sent: Tuesday, February 25, 2025 11:55 AM
To: llvm/llvm-project ***@***.***>
Cc: Jagtap, Pravin ***@***.***>; Team mention ***@***.***>
Subject: Re: [llvm/llvm-project] [AMDGPU][NFC] Added test for live-in CSR SGPR used partially giving MachineVerifier error (PR #126696)
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Can you stack the PR #126926<#126926> along with it? This PR is supposed to fix the error you mentioned in this test. We should be able to see how the proposed fix changes the test if they are stacked together.
In order to stack PRs (assuming graphite), don't we need to create new PRs completely for test & patch as both of these branches as for now are independent & created from my forked repo's main. I am thinking for this time to merge it in upstream & rebase it for the patch PR, that might do the trick for now. Will take care of stacking in such future cases!
—
Reply to this email directly, view it on GitHub<#126696 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGK64FR5MYOBP4QLRFYRVPL2RQEFLAVCNFSM6AAAAABW4NTE7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBQG43DQNRQGI>.
You are receiving this because you are on a team that was mentioned.Message ID: ***@***.***>
[vg0204]vg0204 left a comment (llvm/llvm-project#126696)<#126696 (comment)>
Can you stack the PR #126926<#126926> along with it? This PR is supposed to fix the error you mentioned in this test. We should be able to see how the proposed fix changes the test if they are stacked together.
In order to stack PRs (assuming graphite), don't we need to create new PRs completely for test & patch as both of these branches as for now are independent & created from my forked repo's main. I am thinking for this time to merge it in upstream & rebase it for the patch PR, that might do the trick for now. Will take care of stacking in such future cases!
—
Reply to this email directly, view it on GitHub<#126696 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGK64FR5MYOBP4QLRFYRVPL2RQEFLAVCNFSM6AAAAABW4NTE7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBQG43DQNRQGI>.
You are receiving this because you are on a team that was mentioned.Message ID: ***@***.***>
|
No description provided.