summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-07 20:18:34 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-07 20:18:34 +0000
commit711b390a7c7854679388053e543273c56c25196e (patch)
tree2d4f9a1816b086af1059895e0c9da01716aa074a /llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll
parentee0b2b5c2b9a7e8af3e278b5f9f4aaf10827754f (diff)
downloadbcm5719-llvm-711b390a7c7854679388053e543273c56c25196e.tar.gz
bcm5719-llvm-711b390a7c7854679388053e543273c56c25196e.zip
AMDGPU: Assume SMRD access for constant address space
Since r243294 these are selected to SMRD and moved later if required. llvm-svn: 244354
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll b/llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll
new file mode 100644
index 00000000000..4d70ba83781
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll
@@ -0,0 +1,32 @@
+; RUN: opt -S -codegenprepare -mtriple=amdgcn-unknown-unknown -mcpu=bonaire < %s | FileCheck -check-prefix=OPT -check-prefix=OPT-CI %s
+; RUN: opt -S -codegenprepare -mtriple=amdgcn-unknown-unknown -mcpu=tonga < %s | FileCheck -check-prefix=OPT -check-prefix=OPT-VI %s
+; RUN: llc -march=amdgcn -mcpu=bonaire -mattr=-promote-alloca < %s | FileCheck -check-prefix=GCN -check-prefix=CI %s
+; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-promote-alloca < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
+
+; OPT-LABEL: @test_no_sink_flat_small_offset_i32(
+; OPT: getelementptr i32, i32 addrspace(4)* %in
+; OPT: br i1
+; OPT-NOT: ptrtoint
+
+; GCN-LABEL: {{^}}test_no_sink_flat_small_offset_i32:
+; GCN: flat_load_dword
+; GCN: {{^}}BB0_2:
+define void @test_no_sink_flat_small_offset_i32(i32 addrspace(4)* %out, i32 addrspace(4)* %in, i32 %cond) {
+entry:
+ %out.gep = getelementptr i32, i32 addrspace(4)* %out, i64 999999
+ %in.gep = getelementptr i32, i32 addrspace(4)* %in, i64 7
+ %tmp0 = icmp eq i32 %cond, 0
+ br i1 %tmp0, label %endif, label %if
+
+if:
+ %tmp1 = load i32, i32 addrspace(4)* %in.gep
+ br label %endif
+
+endif:
+ %x = phi i32 [ %tmp1, %if ], [ 0, %entry ]
+ store i32 %x, i32 addrspace(4)* %out.gep
+ br label %done
+
+done:
+ ret void
+}
OpenPOWER on IntegriCloud