[llvm] r373415 - AMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 18:02:24 PDT 2019
Author: arsenm
Date: Tue Oct 1 18:02:24 2019
New Revision: 373415
URL: http://llvm.org/viewvc/llvm-project?rev=373415&view=rev
Log:
AMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX
In principle this should behave as any other constant. However
eliminateFrameIndex currently assumes a VALU use and uses a vector
shift. Work around this by selecting to VGPR for now until
eliminateFrameIndex is fixed.
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/regbankselect-frame-index.mir
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp?rev=373415&r1=373414&r2=373415&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Tue Oct 1 18:02:24 2019
@@ -2138,13 +2138,19 @@ AMDGPURegisterBankInfo::getInstrMapping(
}
case AMDGPU::G_FCONSTANT:
case AMDGPU::G_CONSTANT:
- case AMDGPU::G_FRAME_INDEX:
case AMDGPU::G_GLOBAL_VALUE:
case AMDGPU::G_BLOCK_ADDR: {
unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
OpdsMapping[0] = AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, Size);
break;
}
+ case AMDGPU::G_FRAME_INDEX: {
+ // TODO: This should be the same as other constants, but eliminateFrameIndex
+ // currently assumes VALU uses.
+ unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
+ OpdsMapping[0] = AMDGPU::getValueMapping(AMDGPU::VGPRRegBankID, Size);
+ break;
+ }
case AMDGPU::G_INSERT: {
unsigned BankID = isSALUMapping(MI) ? AMDGPU::SGPRRegBankID :
AMDGPU::VGPRRegBankID;
Modified: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/regbankselect-frame-index.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/regbankselect-frame-index.mir?rev=373415&r1=373414&r2=373415&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/regbankselect-frame-index.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/regbankselect-frame-index.mir Tue Oct 1 18:02:24 2019
@@ -17,7 +17,7 @@ stack:
body: |
bb.0:
; CHECK-LABEL: name: test_frame_index_p5
- ; CHECK: [[FRAME_INDEX:%[0-9]+]]:sgpr(p5) = G_FRAME_INDEX %stack.0.ptr0
+ ; CHECK: [[FRAME_INDEX:%[0-9]+]]:vgpr(p5) = G_FRAME_INDEX %stack.0.ptr0
%0:_(p5) = G_FRAME_INDEX %stack.0.ptr0
...
More information about the llvm-commits
mailing list