summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/break-anti-dependencies.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-25 00:52:40 +0000
committerDan Gohman <gohman@apple.com>2008-11-25 00:52:40 +0000
commit21d9003087c9a707e6cd95460136b499df358fb8 (patch)
tree1cfc267392250dd28a6d3c70050e3dcd359b68d4 /test/CodeGen/X86/break-anti-dependencies.ll
parent662165d2249746b01b154287d3f5ed92f6293c2b (diff)
Initial support for anti-dependence breaking. Currently this code does not
introduce any new spilling; it just uses unused registers. Refactor the SUnit topological sort code out of the RRList scheduler and make use of it to help with the post-pass scheduler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/break-anti-dependencies.ll')
-rw-r--r--test/CodeGen/X86/break-anti-dependencies.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGen/X86/break-anti-dependencies.ll b/test/CodeGen/X86/break-anti-dependencies.ll
new file mode 100644
index 00000000000..8646e3ebe86
--- /dev/null
+++ b/test/CodeGen/X86/break-anti-dependencies.ll
@@ -0,0 +1,33 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -disable-post-RA-scheduler=false > %t
+; RUN: grep {%xmm0} %t | count 14
+; RUN: not grep {%xmm1} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -disable-post-RA-scheduler=false -break-anti-dependencies > %t
+; RUN: grep {%xmm0} %t | count 7
+; RUN: grep {%xmm1} %t | count 7
+
+define void @goo(double* %r, double* %p, double* %q) nounwind {
+entry:
+ %0 = load double* %p, align 8
+ %1 = add double %0, 1.100000e+00
+ %2 = mul double %1, 1.200000e+00
+ %3 = add double %2, 1.300000e+00
+ %4 = mul double %3, 1.400000e+00
+ %5 = add double %4, 1.500000e+00
+ %6 = fptosi double %5 to i32
+ %7 = load double* %r, align 8
+ %8 = add double %7, 7.100000e+00
+ %9 = mul double %8, 7.200000e+00
+ %10 = add double %9, 7.300000e+00
+ %11 = mul double %10, 7.400000e+00
+ %12 = add double %11, 7.500000e+00
+ %13 = fptosi double %12 to i32
+ %14 = icmp slt i32 %6, %13
+ br i1 %14, label %bb, label %return
+
+bb:
+ store double 9.300000e+00, double* %q, align 8
+ ret void
+
+return:
+ ret void
+}