indvars -disable-iv-rewrite: handle cloning binary operators that cannot overflow.
[oota-llvm.git] / test / Transforms / IndVarSimplify / subtract.ll
1 ; RUN: opt < %s -indvars -S | grep indvar
2
3 @G = global i64 0               ; <i64*> [#uses=1]
4
5 define void @test(i64 %V) {
6 ; <label>:0
7         br label %Loop
8
9 Loop:           ; preds = %Loop, %0
10         %X = phi i64 [ 1, %0 ], [ %X.next, %Loop ]              ; <i64> [#uses=2]
11         %X.next = sub i64 %X, %V                ; <i64> [#uses=1]
12         store i64 %X, i64* @G
13         br label %Loop
14 }
15