1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

AMDGPU: Ignore subtarget for InferAddressSpaces

Even if the target doesn't have flat instructions, addrspace(0) is
still flat. It just happens to not work.

llvm-svn: 363561
This commit is contained in:
Matt Arsenault 2019-06-17 14:13:24 +00:00
parent b7b6243629
commit 552bf58679
2 changed files with 14 additions and 2 deletions

View File

@ -180,8 +180,7 @@ public:
// don't use flat addressing.
if (IsGraphicsShader)
return -1;
return ST->hasFlatAddressSpace() ?
AMDGPUAS::FLAT_ADDRESS : AMDGPUAS::UNKNOWN_ADDRESS_SPACE;
return AMDGPUAS::FLAT_ADDRESS;
}
unsigned getVectorSplitCost() { return 0; }

View File

@ -0,0 +1,13 @@
; RUN: opt -S -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -infer-address-spaces %s | FileCheck %s
; Make sure addrspace(0) is still treated as flat on targets without
; flat instructions. It's still flat, it just doesn't work.
; CHECK-LABEL: @load_flat_from_global(
; CHECK-NEXT: %tmp1 = load float, float addrspace(1)* %ptr
; CHECK-NEXT: ret float %tmp1
define float @load_flat_from_global(float addrspace(1)*%ptr) #0 {
%tmp0 = addrspacecast float addrspace(1)* %ptr to float*
%tmp1 = load float, float* %tmp0
ret float %tmp1
}