summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
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
commit93f898f643e1db70a14dbdfdaf686ff25db9fc27 (patch)
tree8692ac3339166022bbbd932bb94efbdeeffd4f06 /llvm/test/CodeGen
parentbb21fac250e112eee3873e31cef2b9b8c144965c (diff)
downloadbcm5719-llvm-93f898f643e1db70a14dbdfdaf686ff25db9fc27.tar.gz
bcm5719-llvm-93f898f643e1db70a14dbdfdaf686ff25db9fc27.zip
Add code for analyzing FP branches. Clean up branch Analysis functions.
llvm-svn: 128718
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/Mips/analyzebranch.ll46
-rw-r--r--llvm/test/CodeGen/Mips/fpcmp.ll4
2 files changed, 48 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/Mips/analyzebranch.ll b/llvm/test/CodeGen/Mips/analyzebranch.ll
new file mode 100644
index 00000000000..8f0bdf286c5
--- /dev/null
+++ b/llvm/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(...)
diff --git a/llvm/test/CodeGen/Mips/fpcmp.ll b/llvm/test/CodeGen/Mips/fpcmp.ll
index 51d55f0a7c4..c89ffe67f1b 100644
--- a/llvm/test/CodeGen/Mips/fpcmp.ll
+++ b/llvm/test/CodeGen/Mips/fpcmp.ll
@@ -10,9 +10,9 @@ entry:
; CHECK-MIPS32R2: c.olt.s
; CHECK-MIPS32R2: movt
; CHECK-MIPS1: c.olt.s
-; CHECK-MIPS1: bc1f
+; CHECK-MIPS1: bc1t
; CHECK-MIPS1: c.olt.s
-; CHECK-MIPS1: bc1f
+; CHECK-MIPS1: bc1t
%cmp = fcmp olt float %f0, %f1
%conv = zext i1 %cmp to i32
%tmp2 = load i32* @g1, align 4
OpenPOWER on IntegriCloud