OLD | NEW |
1 ; This is distilled from a real function that led to a bug in the | 1 ; This is distilled from a real function that led to a bug in the |
2 ; address mode optimization code. It followed assignment chains | 2 ; address mode optimization code. It followed assignment chains |
3 ; through non-SSA temporaries created from Phi instruction lowering. | 3 ; through non-SSA temporaries created from Phi instruction lowering. |
4 ; | 4 ; |
5 ; This test depends to some degree on the stability of "--verbose | 5 ; This test depends to some degree on the stability of "--verbose |
6 ; addropt" output format. | 6 ; addropt" output format. |
7 | 7 |
8 ; RUN: %llvm2ice -O2 --verbose addropt %s | FileCheck %s | 8 ; RUN: %p2i -i %s --args -O2 --verbose addropt | FileCheck %s |
9 | 9 |
10 declare i32 @_calloc_r(i32, i32, i32) | 10 declare i32 @_calloc_r(i32, i32, i32) |
11 | 11 |
12 define internal i32 @_Balloc(i32 %ptr, i32 %k) { | 12 define internal i32 @_Balloc(i32 %ptr, i32 %k) { |
13 entry: | 13 entry: |
14 %gep = add i32 %ptr, 76 | 14 %gep = add i32 %ptr, 76 |
15 %gep.asptr = inttoptr i32 %gep to i32* | 15 %gep.asptr = inttoptr i32 %gep to i32* |
16 %0 = load i32* %gep.asptr, align 1 | 16 %0 = load i32* %gep.asptr, align 1 |
17 %cmp = icmp eq i32 %0, 0 | 17 %cmp = icmp eq i32 %0, 0 |
18 br i1 %cmp, label %if.then, label %if.end5 | 18 br i1 %cmp, label %if.then, label %if.end5 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 ; Instruction: [ 12] %gep_array = mul i32 %k, 4 | 57 ; Instruction: [ 12] %gep_array = mul i32 %k, 4 |
58 ; results in Base=%__4, Index=%k, Shift=2, Offset=0 | 58 ; results in Base=%__4, Index=%k, Shift=2, Offset=0 |
59 ; | 59 ; |
60 ; CHECK-NOT: results in Base=%__4, | 60 ; CHECK-NOT: results in Base=%__4, |
61 ; | 61 ; |
62 ret i32 %2 | 62 ret i32 %2 |
63 | 63 |
64 return: ; preds = %if.then | 64 return: ; preds = %if.then |
65 ret i32 0 | 65 ret i32 0 |
66 } | 66 } |
OLD | NEW |