At Chris' suggestion, move the liveness and worklist datastructures into
[oota-llvm.git] / test / Transforms / IndVarsSimplify / 2002-09-09-PointerIndVar.ll
index 4c80e4851f41f780fb04fb9f8e496bfe2538b636..228772eb82cc63a69b4d8f44bb94a5315f220b2b 100644 (file)
@@ -1,16 +1,17 @@
 ; Induction variable pass is doing bad things with pointer induction vars, 
 ; trying to do arithmetic on them directly.
 ;
-; RUN: llvm-upgrade < %s | llvm-as | opt -indvars
+; RUN: llvm-as < %s | opt -indvars
 ;
-void %test(int %A, uint %S, sbyte* %S) {
+define void @test(i32 %A, i32 %S, i8* %S.upgrd.1) {
+; <label>:0
+        br label %Loop
 
-       br label %Loop
-Loop:
-       %PIV = phi sbyte* [%S, %0], [%PIVNext, %Loop]
-
-       %PIV = cast sbyte* %PIV to ulong
-       %PIVNext = add ulong %PIV, 8
-       %PIVNext = cast ulong %PIVNext to sbyte*
-       br label %Loop
+Loop:           ; preds = %Loop, %0
+        %PIV = phi i8* [ %S.upgrd.1, %0 ], [ %PIVNext.upgrd.3, %Loop ]          ; <i8*> [#uses=1]
+        %PIV.upgrd.2 = ptrtoint i8* %PIV to i64         ; <i64> [#uses=1]
+        %PIVNext = add i64 %PIV.upgrd.2, 8              ; <i64> [#uses=1]
+        %PIVNext.upgrd.3 = inttoptr i64 %PIVNext to i8*         ; <i8*> [#uses=1]
+        br label %Loop
 }
+