-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AMDGPU][GlobalISel]selectImpl() may create illegal copy from VGPR to SGPR #62035
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
Comments
@llvm/issue-subscribers-backend-amdgpu |
I am interested in this issue. Can someone assign to me. |
There's been a number of changes to boolean handling since this was filed. cc @petar-avramovic |
Sorry for the delay. Totally lost track for this issue. To reproduce the bug, try following change and run diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
index dcb0f47973c4..9be4b6744cc1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
@@ -3609,8 +3609,9 @@ bool AMDGPUInstructionSelector::select(MachineInstr &I) {
// This is a workaround. For extension from type i1, `selectImpl()` uses
// patterns from TD file and generates an illegal VGPR to SGPR COPY as type
// i1 can only be hold in a SGPR class.
- if (MRI->getType(I.getOperand(1).getReg()) != LLT::scalar(1) &&
- selectImpl(I, *CoverageInfo))
+ //if (MRI->getType(I.getOperand(1).getReg()) != LLT::scalar(1) &&
+ // selectImpl(I, *CoverageInfo))
+ if (selectImpl(I, *CoverageInfo))
return true;
return selectG_SZA_EXT(I);
case TargetOpcode::G_FPEXT:
an error:
|
Thank you @chenzheng1030 ! I have been really busy lately, but when I have a chance I would like to circle back to this issue if no one else has picked it up. |
This is found during investigation of issue #61468
After importing more td patterns to global
MatchTable
, for example the patterns in https://reviews.llvm.org/D147780,selectImpl()
will create illegal copy.For now in https://reviews.llvm.org/D147780, this issue is workaround by not using
selectImpl()
to do the selection. But maybe a fix inselectImpl()
should be made to avoid such issue.The text was updated successfully, but these errors were encountered: