OLD | NEW |
1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s | 1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s |
2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
3 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s | 3 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| 4 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
| 5 ; RUN: | FileCheck --check-prefix=DUMP %s |
4 | 6 |
5 ; This file is lowered from C code that does some simple aritmetic with | 7 ; This file is lowered from C code that does some simple aritmetic with |
6 ; struct members. It's also built with the PNaCl toolchain so this is the | 8 ; struct members. It's also built with the PNaCl toolchain so this is the |
7 ; stable ABI subset of LLVM IR (structs are gone, pointers turned into i32, | 9 ; stable ABI subset of LLVM IR (structs are gone, pointers turned into i32, |
8 ; geps gone, etc.) | 10 ; geps gone, etc.) |
9 | 11 |
10 define internal i32 @compute_important_function(i32 %v1, i32 %v2) { | 12 define internal i32 @compute_important_function(i32 %v1, i32 %v2) { |
11 entry: | 13 entry: |
12 %v1.asptr = inttoptr i32 %v1 to i32* | 14 %__2 = inttoptr i32 %v1 to i32* |
13 %_v0 = load i32* %v1.asptr, align 1 | 15 %_v0 = load i32* %__2, align 1 |
14 | 16 |
15 ; CHECK: entry: | 17 ; CHECK: entry: |
16 ; CHECK-NEXT: %v1.asptr = i32 %v1 | 18 ; CHECK-NEXT: %__2 = i32 %v1 |
17 ; CHECK-NEXT: %_v0 = load i32* {{.*}}, align 1 | 19 ; CHECK-NEXT: %_v0 = load i32* {{.*}}, align 1 |
18 | 20 |
19 %v2.asptr = inttoptr i32 %v2 to i32* | 21 %__4 = inttoptr i32 %v2 to i32* |
20 %_v1 = load i32* %v2.asptr, align 1 | 22 %_v1 = load i32* %__4, align 1 |
21 %gep = add i32 %v2, 12 | 23 %gep = add i32 %v2, 12 |
22 %gep.asptr = inttoptr i32 %gep to i32* | 24 %__7 = inttoptr i32 %gep to i32* |
23 %_v2 = load i32* %gep.asptr, align 1 | 25 %_v2 = load i32* %__7, align 1 |
24 %mul = mul i32 %_v2, %_v1 | 26 %mul = mul i32 %_v2, %_v1 |
25 %gep6 = add i32 %v1, 4 | 27 %gep6 = add i32 %v1, 4 |
26 %gep6.asptr = inttoptr i32 %gep6 to i32* | 28 %__11 = inttoptr i32 %gep6 to i32* |
27 %_v3 = load i32* %gep6.asptr, align 1 | 29 %_v3 = load i32* %__11, align 1 |
28 %gep8 = add i32 %v2, 8 | 30 %gep8 = add i32 %v2, 8 |
29 %gep8.asptr = inttoptr i32 %gep8 to i32* | 31 %__14 = inttoptr i32 %gep8 to i32* |
30 %_v4 = load i32* %gep8.asptr, align 1 | 32 %_v4 = load i32* %__14, align 1 |
31 %gep10 = add i32 %v2, 4 | 33 %gep10 = add i32 %v2, 4 |
32 %gep10.asptr = inttoptr i32 %gep10 to i32* | 34 %__17 = inttoptr i32 %gep10 to i32* |
33 %_v5 = load i32* %gep10.asptr, align 1 | 35 %_v5 = load i32* %__17, align 1 |
34 %mul3 = mul i32 %_v5, %_v4 | 36 %mul3 = mul i32 %_v5, %_v4 |
35 %gep12 = add i32 %v1, 8 | 37 %gep12 = add i32 %v1, 8 |
36 %gep12.asptr = inttoptr i32 %gep12 to i32* | 38 %__21 = inttoptr i32 %gep12 to i32* |
37 %_v6 = load i32* %gep12.asptr, align 1 | 39 %_v6 = load i32* %__21, align 1 |
38 %mul7 = mul i32 %_v6, %_v3 | 40 %mul7 = mul i32 %_v6, %_v3 |
39 %mul9 = mul i32 %mul7, %_v6 | 41 %mul9 = mul i32 %mul7, %_v6 |
40 %gep14 = add i32 %v1, 12 | 42 %gep14 = add i32 %v1, 12 |
41 %gep14.asptr = inttoptr i32 %gep14 to i32* | 43 %__26 = inttoptr i32 %gep14 to i32* |
42 %_v7 = load i32* %gep14.asptr, align 1 | 44 %_v7 = load i32* %__26, align 1 |
43 %mul11 = mul i32 %mul9, %_v7 | 45 %mul11 = mul i32 %mul9, %_v7 |
44 %add4.neg = add i32 %mul, %_v0 | 46 %add4.neg = add i32 %mul, %_v0 |
45 %add = sub i32 %add4.neg, %_v3 | 47 %add = sub i32 %add4.neg, %_v3 |
46 %sub = sub i32 %add, %mul3 | 48 %sub = sub i32 %add, %mul3 |
47 %sub12 = sub i32 %sub, %mul11 | 49 %sub12 = sub i32 %sub, %mul11 |
48 ret i32 %sub12 | 50 ret i32 %sub12 |
49 | 51 |
50 ; CHECK: %sub12 = sub i32 %sub, %mul11 | 52 ; CHECK: %sub12 = sub i32 %sub, %mul11 |
51 ; CHECK-NEXT: ret i32 %sub12 | 53 ; CHECK-NEXT: ret i32 %sub12 |
52 } | 54 } |
53 | 55 |
54 ; ERRORS-NOT: ICE translation error | 56 ; ERRORS-NOT: ICE translation error |
55 ; DUMP-NOT: SZ | 57 ; DUMP-NOT: SZ |
OLD | NEW |