-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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] Fix unreachable reg bit width #122107
Changes from 10 commits
cfbc8ad
a083e08
163fcc1
89e1047
b1eddc3
64378c4
61cde04
b971e70
5706df1
6b9cfce
614c83d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -run-pass=postmisched -o - %s | FileCheck %s | ||
--- | ||
name: test_xnull_256 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the 128 case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @arsenm , to trigger the unreachable during postmisched pass it has to be MIMG instruction, but I cannot find MIMG instruction uses SReg_128_XNULL I also tried to find other places that may use the bit width function:
The only possibility is getRegSplitParts, but it is used by many function, I need help on this since I do not familiar with the fucntion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect the selectCOPY case would be most straightforward There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @arsenm , to successfully trigger bit width function in selectCOPY, the dst operand must:
I think the bit width of src and dst must be the same, otherwise the copy mismatch type verification error will trigger Thus to use SReg_128_XNULL as src reg class, the dst must also be 128 bit width To pass the
For COPY not being assigned for reg class, I think the dst of COPY must not be used for any instruction. Because each instruction's each input should have a reg class bind with it, and ti will try to assign reg class accordingly. But if COPY is not used by any instruction, then it will not be selected, since it most probably will not pass So it seems like I ran out of my ways to produce a 128 case, would there be any other possibilities? Thanks a lot! BTW, I also tried to remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original problem was triggered by SReg_256_XNULL. So maybe we just fix it for that reg class? |
||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: test_xnull_256 | ||
; CHECK: IMAGE_STORE_V4_V2_gfx90a $vgpr0_vgpr1_vgpr2_vgpr3, killed $vgpr8_vgpr9, killed $sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31, 15, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable store (s128), addrspace 8) | ||
; CHECK-NEXT: $vgpr2 = V_LSHRREV_B32_e32 4, killed $vgpr2, implicit $exec | ||
IMAGE_STORE_V4_V2_gfx90a $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr8_vgpr9, $sgpr24_sgpr25_sgpr26_sgpr27_sgpr28_sgpr29_sgpr30_sgpr31, 15, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable store (s128), addrspace 8) | ||
$vgpr2 = V_LSHRREV_B32_e32 4, $vgpr2, implicit $exec | ||
... | ||
|
||
|
||
# FIXME: We need xnull_128 test case (which reach unreachable in function AMDGPU::getRegBitWidth). Currently cannot find one |
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.
Rename test file