summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-07-02 14:40:22 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-07-02 14:40:22 +0000
commit70a4d3f67ca9e7fa676a90e89470765d0b8246a7 (patch)
tree0f59d6603c4e15c0c1895457e413e93635f84b2d /llvm/lib/Target/AMDGPU
parented633992445823cd319bae171a42355455749467 (diff)
downloadbcm5719-llvm-70a4d3f67ca9e7fa676a90e89470765d0b8246a7.tar.gz
bcm5719-llvm-70a4d3f67ca9e7fa676a90e89470765d0b8246a7.zip
AMDGPU/GlobalISel: Fix G_GEP with mixed SGPR/VGPR operands
The register bank for the destination of the sample argument copy was wrong. We shouldn't be constraining each source to the result register bank. Allow constraining the original register to the right size. llvm-svn: 364928
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
index c7e5f05d401..c99707ed697 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
@@ -278,12 +278,15 @@ bool AMDGPUInstructionSelector::selectG_ADD(MachineInstr &I) const {
.add(Lo1)
.add(Lo2)
.addImm(0);
- BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_ADDC_U32_e64), DstHi)
+ MachineInstr *Addc = BuildMI(*BB, &I, DL, TII.get(AMDGPU::V_ADDC_U32_e64), DstHi)
.addDef(MRI.createVirtualRegister(CarryRC), RegState::Dead)
.add(Hi1)
.add(Hi2)
.addReg(CarryReg, RegState::Kill)
.addImm(0);
+
+ if (!constrainSelectedInstRegOperands(*Addc, TII, TRI, RBI))
+ return false;
}
BuildMI(*BB, &I, DL, TII.get(AMDGPU::REG_SEQUENCE), DstReg)
@@ -292,9 +295,8 @@ bool AMDGPUInstructionSelector::selectG_ADD(MachineInstr &I) const {
.addReg(DstHi)
.addImm(AMDGPU::sub1);
- if (!RBI.constrainGenericRegister(DstReg, RC, MRI) ||
- !RBI.constrainGenericRegister(I.getOperand(1).getReg(), RC, MRI) ||
- !RBI.constrainGenericRegister(I.getOperand(2).getReg(), RC, MRI))
+
+ if (!RBI.constrainGenericRegister(DstReg, RC, MRI))
return false;
I.eraseFromParent();
OpenPOWER on IntegriCloud