PR9055: extend the fix to PR4050 (r70179) to apply to zext and anyext.
[oota-llvm.git] / test / Transforms / LICM / 2003-12-11-SinkingToPHI.ll
index 955e70b8e95345d9ef1bccf523d60cf5a2168ffc..67c3951d74e4a125153b337d44b8e9b92c8b7c4b 100644 (file)
@@ -1,20 +1,16 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -licm | lli
+; RUN: opt < %s -licm | lli
 
-implementation   ; Functions:
-
-int %main() {
+define i32 @main() {
 entry:
        br label %Loop
-
-Loop:
-       br bool true, label %LoopCont, label %Out
-LoopCont:
-       %X = add int 1, 0
-       br bool true, label %Out, label %Loop
-
-Out:
-       %V = phi int [ 2, %Loop], [ %X, %LoopCont]
-       %V2 = sub int %V, 1
-       ret int %V2
+Loop:          ; preds = %LoopCont, %entry
+       br i1 true, label %LoopCont, label %Out
+LoopCont:              ; preds = %Loop
+       %X = add i32 1, 0               ; <i32> [#uses=1]
+       br i1 true, label %Out, label %Loop
+Out:           ; preds = %LoopCont, %Loop
+       %V = phi i32 [ 2, %Loop ], [ %X, %LoopCont ]            ; <i32> [#uses=1]
+       %V2 = sub i32 %V, 1             ; <i32> [#uses=1]
+       ret i32 %V2
 }