summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-05-31 09:22:35 -0700
committerTom Stellard <thomas.stellard@amd.com>2013-06-05 03:32:40 +0000
commit95c41e51bd523b93c191c9a2e8ef2d3b2ab500d4 (patch)
tree50680fbe0211eb5a6b6433816f028cc4e09572fc /test
parent23a22cdedda691b5ed39f75bc1a846fd890f07fb (diff)
R600: Make sure to schedule AR register uses and defs in the same clause
Reviewed-by: vljn at ovi.com
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/R600/indirect-addressing.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/R600/indirect-addressing.ll b/test/CodeGen/R600/indirect-addressing.ll
new file mode 100644
index 00000000000..7291cb42e7f
--- /dev/null
+++ b/test/CodeGen/R600/indirect-addressing.ll
@@ -0,0 +1,32 @@
+; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
+
+; This test checks that uses and defs of the AR register happen in the same
+; instruction clause.
+
+; CHECK: @mova_same_clause
+; CHECK: MOVA_INT
+; CHECK-NOT: ALU clause
+; CHECK: 0 + AR.x
+; CHECK: MOVA_INT
+; CHECK-NOT: ALU clause
+; CHECK: 0 + AR.x
+
+define void @mova_same_clause(i32 addrspace(1)* nocapture %out, i32 addrspace(1)* nocapture %in) {
+entry:
+ %stack = alloca [5 x i32], align 4
+ %0 = load i32 addrspace(1)* %in, align 4
+ %arrayidx1 = getelementptr inbounds [5 x i32]* %stack, i32 0, i32 %0
+ store i32 4, i32* %arrayidx1, align 4
+ %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %in, i32 1
+ %1 = load i32 addrspace(1)* %arrayidx2, align 4
+ %arrayidx3 = getelementptr inbounds [5 x i32]* %stack, i32 0, i32 %1
+ store i32 5, i32* %arrayidx3, align 4
+ %arrayidx10 = getelementptr inbounds [5 x i32]* %stack, i32 0, i32 0
+ %2 = load i32* %arrayidx10, align 4
+ store i32 %2, i32 addrspace(1)* %out, align 4
+ %arrayidx12 = getelementptr inbounds [5 x i32]* %stack, i32 0, i32 1
+ %3 = load i32* %arrayidx12
+ %arrayidx13 = getelementptr inbounds i32 addrspace(1)* %out, i32 1
+ store i32 %3, i32 addrspace(1)* %arrayidx13
+ ret void
+}