diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-11-16 20:50:54 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-11-16 20:50:54 +0000 |
commit | e6e811277f045ee3d61cd62622d71005c47eb48d (patch) | |
tree | 7d3d8fa4880b377e58779495a1657d0777863825 /test/CodeGen/R600/32-bit-local-address-space.ll | |
parent | 4fe5b640ee935f983db9445dc9fdb4009d4fa639 (diff) | |
download | external_llvm-e6e811277f045ee3d61cd62622d71005c47eb48d.zip external_llvm-e6e811277f045ee3d61cd62622d71005c47eb48d.tar.gz external_llvm-e6e811277f045ee3d61cd62622d71005c47eb48d.tar.bz2 |
Fix assert on unaligned access to global with different address space size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600/32-bit-local-address-space.ll')
-rw-r--r-- | test/CodeGen/R600/32-bit-local-address-space.ll | 24 |
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 +} |