summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-07-21 14:01:14 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-07-21 14:01:14 +0000
commit067c81567bf35e04b2c9b3d360a6f15dedbfe8aa (patch)
tree1031a76ce68e6100ccade83f3b1ccc15cf2ecba5 /llvm/test/CodeGen
parentb2114caf627f38eaa7905d3ad911971206b1caa9 (diff)
downloadbcm5719-llvm-067c81567bf35e04b2c9b3d360a6f15dedbfe8aa.tar.gz
bcm5719-llvm-067c81567bf35e04b2c9b3d360a6f15dedbfe8aa.zip
R600/SI: Store constant initializer data in constant memory
This implements a solution for constant initializers suggested by Vadim Girlin, where we store the data after the shader code and then use the S_GETPC instruction to compute its address. This saves use the trouble of creating a new buffer for constant data and then having to pass the pointer to the kernel via user SGPRs or the input buffer. llvm-svn: 213530
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/R600/gv-const-addrspace.ll10
-rw-r--r--llvm/test/CodeGen/R600/large-constant-initializer.ll3
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/R600/gv-const-addrspace.ll b/llvm/test/CodeGen/R600/gv-const-addrspace.ll
index db64a6fe8c7..074d9087ee6 100644
--- a/llvm/test/CodeGen/R600/gv-const-addrspace.ll
+++ b/llvm/test/CodeGen/R600/gv-const-addrspace.ll
@@ -4,11 +4,11 @@
@b = internal addrspace(2) constant [1 x i16] [ i16 7 ], align 2
-; XXX: Test on SI once 64-bit adds are supportes.
-
@float_gv = internal unnamed_addr addrspace(2) constant [5 x float] [float 0.0, float 1.0, float 2.0, float 3.0, float 4.0], align 4
; FUNC-LABEL: @float
+; FIXME: We should be using S_LOAD_DWORD here.
+; SI: BUFFER_LOAD_DWORD
; EG-DAG: MOV {{\** *}}T2.X
; EG-DAG: MOV {{\** *}}T3.X
@@ -29,6 +29,9 @@ entry:
; FUNC-LABEL: @i32
+; FIXME: We should be using S_LOAD_DWORD here.
+; SI: BUFFER_LOAD_DWORD
+
; EG-DAG: MOV {{\** *}}T2.X
; EG-DAG: MOV {{\** *}}T3.X
; EG-DAG: MOV {{\** *}}T4.X
@@ -50,6 +53,7 @@ entry:
@struct_foo_gv = internal unnamed_addr addrspace(2) constant [1 x %struct.foo] [ %struct.foo { float 16.0, [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4] } ]
; FUNC-LABEL: @struct_foo_gv_load
+; SI: S_LOAD_DWORD
define void @struct_foo_gv_load(i32 addrspace(1)* %out, i32 %index) {
%gep = getelementptr inbounds [1 x %struct.foo] addrspace(2)* @struct_foo_gv, i32 0, i32 0, i32 1, i32 %index
@@ -64,6 +68,8 @@ define void @struct_foo_gv_load(i32 addrspace(1)* %out, i32 %index) {
<1 x i32> <i32 4> ]
; FUNC-LABEL: @array_v1_gv_load
+; FIXME: We should be using S_LOAD_DWORD here.
+; SI: BUFFER_LOAD_DWORD
define void @array_v1_gv_load(<1 x i32> addrspace(1)* %out, i32 %index) {
%gep = getelementptr inbounds [4 x <1 x i32>] addrspace(2)* @array_v1_gv, i32 0, i32 %index
%load = load <1 x i32> addrspace(2)* %gep, align 4
diff --git a/llvm/test/CodeGen/R600/large-constant-initializer.ll b/llvm/test/CodeGen/R600/large-constant-initializer.ll
index 552cd05e137..191b5c3de91 100644
--- a/llvm/test/CodeGen/R600/large-constant-initializer.ll
+++ b/llvm/test/CodeGen/R600/large-constant-initializer.ll
@@ -1,6 +1,5 @@
-; XFAIL: *
-; REQUIRES: asserts
; RUN: llc -march=r600 -mcpu=SI < %s
+; CHECK: S_ENDPGM
@gv = external unnamed_addr addrspace(2) constant [239 x i32], align 4
OpenPOWER on IntegriCloud