diff options
Diffstat (limited to 'llvm/test/CodeGen/R600/private-memory.ll')
| -rw-r--r-- | llvm/test/CodeGen/R600/private-memory.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/private-memory.ll b/llvm/test/CodeGen/R600/private-memory.ll index b25fc7ba572..1bd17bf6048 100644 --- a/llvm/test/CodeGen/R600/private-memory.ll +++ b/llvm/test/CodeGen/R600/private-memory.ll @@ -180,4 +180,35 @@ entry: ret void } +; Test that two stack objects are not stored in the same register +; The second stack object should be in T3.X +; FUNC-LABEL: @no_overlap +; R600-CHECK: MOV {{\** *}}T3.X +; SI-CHECK: V_MOV_B32_e32 v3 +define void @no_overlap(i32 addrspace(1)* %out, i32 %in) { +entry: + %0 = alloca [3 x i8], align 1 + %1 = alloca [2 x i8], align 1 + %2 = getelementptr [3 x i8]* %0, i32 0, i32 0 + %3 = getelementptr [3 x i8]* %0, i32 0, i32 1 + %4 = getelementptr [3 x i8]* %0, i32 0, i32 2 + %5 = getelementptr [2 x i8]* %1, i32 0, i32 0 + %6 = getelementptr [2 x i8]* %1, i32 0, i32 1 + store i8 0, i8* %2 + store i8 1, i8* %3 + store i8 2, i8* %4 + store i8 1, i8* %5 + store i8 0, i8* %6 + %7 = getelementptr [3 x i8]* %0, i32 0, i32 %in + %8 = getelementptr [2 x i8]* %1, i32 0, i32 %in + %9 = load i8* %7 + %10 = load i8* %8 + %11 = add i8 %9, %10 + %12 = sext i8 %11 to i32 + store i32 %12, i32 addrspace(1)* %out + ret void +} + + + declare i32 @llvm.r600.read.tidig.x() nounwind readnone |

