-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU][True16] fix a bug in codeGen causing e64 with wrong vgpr type to shrink #102942
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
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Brox Chen (broxigarchen) ChangesThis bug is introduced in #102198 Full diff: https://github.com/llvm/llvm-project/pull/102942.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
index 155747551471e..5d38cafd73dd9 100644
--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
@@ -1048,7 +1048,7 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
MachineFunctionProperties::Property::NoVRegs))
continue;
- if (ST->useRealTrue16Insts() && AMDGPU::isTrue16Inst(MI.getOpcode()) &&
+ if (ST->hasTrue16BitInsts() && AMDGPU::isTrue16Inst(MI.getOpcode()) &&
!shouldShrinkTrue16(MI))
continue;
|
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. We can revert this part of the patch until all instructions are properly updated.
Can you include a test case? |
Thanks, I verified that it fixes the issue in our project! |
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.
Needs test
Added a small test to verify and to prevent furture failure. Should be expanded when more true16 and fake16 instructions are supported |
109eaf0
to
6fb5015
Compare
This bug is introduced in #102198
The previous path change to use realTrue16 flag, however, we have some t16 instructions that are implemented with fake16, and has Lo128 registers types. Thus we should still using hasTrue16Bit flag for shrinking check