aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Mips/analyzebranch.ll
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-04-01 17:39:08 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-04-01 17:39:08 +0000
commit20ada98de82cb23c3f075acbb09436760ef0923c (patch)
treebe1dcb4da58d79d3d69afb9cdb452069e6f55723 /test/CodeGen/Mips/analyzebranch.ll
parent0e3ee43ea058a35ab5ce69cceafd316d49eaad34 (diff)
downloadexternal_llvm-20ada98de82cb23c3f075acbb09436760ef0923c.zip
external_llvm-20ada98de82cb23c3f075acbb09436760ef0923c.tar.gz
external_llvm-20ada98de82cb23c3f075acbb09436760ef0923c.tar.bz2
Add code for analyzing FP branches. Clean up branch Analysis functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/analyzebranch.ll')
-rw-r--r--test/CodeGen/Mips/analyzebranch.ll46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/analyzebranch.ll b/test/CodeGen/Mips/analyzebranch.ll
new file mode 100644
index 0000000..8f0bdf2
--- /dev/null
+++ b/test/CodeGen/Mips/analyzebranch.ll
@@ -0,0 +1,46 @@
+; RUN: llc -march=mips < %s | FileCheck %s
+
+define double @foo(double %a, double %b) nounwind readnone {
+entry:
+; CHECK: bc1f $BB0_2
+; CHECK: nop
+; CHECK: # BB#1:
+
+ %cmp = fcmp ogt double %a, 0.000000e+00
+ br i1 %cmp, label %if.end6, label %if.else
+
+if.else: ; preds = %entry
+ %cmp3 = fcmp ogt double %b, 0.000000e+00
+ br i1 %cmp3, label %if.end6, label %return
+
+if.end6: ; preds = %if.else, %entry
+ %c.0 = phi double [ %a, %entry ], [ 0.000000e+00, %if.else ]
+ %sub = fsub double %b, %c.0
+ %mul = fmul double %sub, 2.000000e+00
+ br label %return
+
+return: ; preds = %if.else, %if.end6
+ %retval.0 = phi double [ %mul, %if.end6 ], [ 0.000000e+00, %if.else ]
+ ret double %retval.0
+}
+
+define void @f1(float %f) nounwind {
+entry:
+; CHECK: bc1t $BB1_2
+; CHECK: nop
+; CHECK: # BB#1:
+ %cmp = fcmp une float %f, 0.000000e+00
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ tail call void @abort() noreturn
+ unreachable
+
+if.end: ; preds = %entry
+ tail call void (...)* @f2() nounwind
+ ret void
+}
+
+declare void @abort() noreturn nounwind
+
+declare void @f2(...)