aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/R600/32-bit-local-address-space.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/R600/32-bit-local-address-space.ll')
-rw-r--r--test/CodeGen/R600/32-bit-local-address-space.ll24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/CodeGen/R600/32-bit-local-address-space.ll b/test/CodeGen/R600/32-bit-local-address-space.ll
index 2ae4671..566a422 100644
--- a/test/CodeGen/R600/32-bit-local-address-space.ll
+++ b/test/CodeGen/R600/32-bit-local-address-space.ll
@@ -50,4 +50,26 @@ define void @null_32bit_lds_ptr(i32 addrspace(1)* %out, i32 addrspace(3)* %lds)
%x = select i1 %cmp, i32 123, i32 456
store i32 %x, i32 addrspace(1)* %out
ret void
-} \ No newline at end of file
+}
+
+; CHECK-LABEL: @mul_32bit_ptr:
+; CHECK: V_MUL_LO_I32
+; CHECK-NEXT: V_ADD_I32_e32
+; CHECK-NEXT: DS_READ_B32
+define void @mul_32bit_ptr(float addrspace(1)* %out, [3 x float] addrspace(3)* %lds, i32 %tid) {
+ %ptr = getelementptr [3 x float] addrspace(3)* %lds, i32 %tid, i32 0
+ %val = load float addrspace(3)* %ptr
+ store float %val, float addrspace(1)* %out
+ ret void
+}
+
+@g_lds = addrspace(3) global float zeroinitializer, align 4
+
+; CHECK-LABEL: @infer_ptr_alignment_global_offset:
+; CHECK: V_MOV_B32_e32 [[REG:v[0-9]+]], 0
+; CHECK: DS_READ_B32 v{{[0-9]+}}, 0, [[REG]]
+define void @infer_ptr_alignment_global_offset(float addrspace(1)* %out, i32 %tid) {
+ %val = load float addrspace(3)* @g_lds
+ store float %val, float addrspace(1)* %out
+ ret void
+}