From: Matt Arsenault Date: Mon, 1 Jul 2019 13:37:39 +0000 (+0000) Subject: AMDGPU/GlobalISel: Fail on store to 32-bit address space X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d12e3c69f0da75e514a114ac284d0a927b56a980;p=llvm AMDGPU/GlobalISel: Fail on store to 32-bit address space git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364766 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp index b776b4137df..ece01b511cd 100644 --- a/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp +++ b/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp @@ -549,6 +549,12 @@ bool AMDGPUInstructionSelector::selectG_STORE(MachineInstr &I) const { MachineFunction *MF = BB->getParent(); MachineRegisterInfo &MRI = MF->getRegInfo(); DebugLoc DL = I.getDebugLoc(); + unsigned PtrSize = RBI.getSizeInBits(I.getOperand(1).getReg(), MRI, TRI); + if (PtrSize != 64) { + LLVM_DEBUG(dbgs() << "Unhandled address space\n"); + return false; + } + unsigned StoreSize = RBI.getSizeInBits(I.getOperand(0).getReg(), MRI, TRI); unsigned Opcode; diff --git a/test/CodeGen/AMDGPU/GlobalISel/inst-select-implicit-def.mir b/test/CodeGen/AMDGPU/GlobalISel/inst-select-implicit-def.mir index 3fde1f04a8c..6edd3fa10ff 100644 --- a/test/CodeGen/AMDGPU/GlobalISel/inst-select-implicit-def.mir +++ b/test/CodeGen/AMDGPU/GlobalISel/inst-select-implicit-def.mir @@ -119,9 +119,9 @@ regBankSelected: true body: | bb.0: ; GCN-LABEL: name: implicit_def_p3_vgpr - ; GCN: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF - ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 4, implicit $exec - ; GCN: FLAT_STORE_DWORD [[DEF]], [[V_MOV_B32_e32_]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr + ; GCN: [[DEF:%[0-9]+]]:vgpr(p3) = G_IMPLICIT_DEF + ; GCN: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 4 + ; GCN: G_STORE [[C]](s32), [[DEF]](p3) :: (store 4, addrspace 1) %0:vgpr(p3) = G_IMPLICIT_DEF %1:vgpr(s32) = G_CONSTANT i32 4 G_STORE %1, %0 :: (store 4, addrspace 1)