[llvm-commits] [llvm] r112617 - in /llvm/trunk/test/Transforms/TailCallElim: accum_recursion.ll switch.ll
Chris Lattner
sabre at nondot.org
Tue Aug 31 11:44:03 PDT 2010
Author: lattner
Date: Tue Aug 31 13:44:03 2010
New Revision: 112617
URL: http://llvm.org/viewvc/llvm-project?rev=112617&view=rev
Log:
merge two tests.
Removed:
llvm/trunk/test/Transforms/TailCallElim/switch.ll
Modified:
llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll
Modified: llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll?rev=112617&r1=112616&r2=112617&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll (original)
+++ llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll Tue Aug 31 13:44:03 2010
@@ -37,4 +37,38 @@
; CHECK: define i32 @test2_mul
; CHECK: phi i32
; CHECK-NOT: call i32
-; CHECK: return:
\ No newline at end of file
+; CHECK: return:
+
+
+define i64 @test3_fib(i64 %n) nounwind readnone {
+; CHECK: @test3_fib
+entry:
+; CHECK: tailrecurse:
+; CHECK: %accumulator.tr = phi i64 [ %n, %entry ], [ %3, %bb1 ]
+; CHECK: %n.tr = phi i64 [ %n, %entry ], [ %2, %bb1 ]
+ switch i64 %n, label %bb1 [
+; CHECK: switch i64 %n.tr, label %bb1 [
+ i64 0, label %bb2
+ i64 1, label %bb2
+ ]
+
+bb1:
+; CHECK: bb1:
+ %0 = add i64 %n, -1
+; CHECK: %0 = add i64 %n.tr, -1
+ %1 = tail call i64 @test3_fib(i64 %0) nounwind
+; CHECK: %1 = tail call i64 @test3_fib(i64 %0)
+ %2 = add i64 %n, -2
+; CHECK: %2 = add i64 %n.tr, -2
+ %3 = tail call i64 @test3_fib(i64 %2) nounwind
+; CHECK-NOT: tail call i64 @test3_fib
+ %4 = add nsw i64 %3, %1
+; CHECK: add nsw i64 %accumulator.tr, %1
+ ret i64 %4
+; CHECK: br label %tailrecurse
+
+bb2:
+; CHECK: bb2:
+ ret i64 %n
+; CHECK: ret i64 %accumulator.tr
+}
Removed: llvm/trunk/test/Transforms/TailCallElim/switch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/TailCallElim/switch.ll?rev=112616&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/TailCallElim/switch.ll (original)
+++ llvm/trunk/test/Transforms/TailCallElim/switch.ll (removed)
@@ -1,34 +0,0 @@
-; RUN: opt %s -tailcallelim -S | FileCheck %s
-
-define i64 @fib(i64 %n) nounwind readnone {
-; CHECK: @fib
-entry:
-; CHECK: tailrecurse:
-; CHECK: %accumulator.tr = phi i64 [ %n, %entry ], [ %3, %bb1 ]
-; CHECK: %n.tr = phi i64 [ %n, %entry ], [ %2, %bb1 ]
- switch i64 %n, label %bb1 [
-; CHECK: switch i64 %n.tr, label %bb1 [
- i64 0, label %bb2
- i64 1, label %bb2
- ]
-
-bb1:
-; CHECK: bb1:
- %0 = add i64 %n, -1
-; CHECK: %0 = add i64 %n.tr, -1
- %1 = tail call i64 @fib(i64 %0) nounwind
-; CHECK: %1 = tail call i64 @fib(i64 %0)
- %2 = add i64 %n, -2
-; CHECK: %2 = add i64 %n.tr, -2
- %3 = tail call i64 @fib(i64 %2) nounwind
-; CHECK-NOT: tail call i64 @fib
- %4 = add nsw i64 %3, %1
-; CHECK: add nsw i64 %accumulator.tr, %1
- ret i64 %4
-; CHECK: br label %tailrecurse
-
-bb2:
-; CHECK: bb2:
- ret i64 %n
-; CHECK: ret i64 %accumulator.tr
-}
More information about the llvm-commits
mailing list