OLD | NEW |
(Empty) | |
| 1 ; RUIN: %llvm2ice -verbose inst %s | FileCheck %s |
| 2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
| 3 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s |
| 4 |
| 5 ; 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 |
| 7 ; stable ABI subset of LLVM IR (structs are gone, pointers turned into i32, |
| 8 ; geps gone, etc.) |
| 9 |
| 10 define internal i32 @compute_important_function(i32 %v1, i32 %v2) { |
| 11 entry: |
| 12 %v1.asptr = inttoptr i32 %v1 to i32* |
| 13 %_v0 = load i32* %v1.asptr, align 1 |
| 14 |
| 15 ; CHECK: entry: |
| 16 ; CHECK-NEXT: %v1.asptr = i32 %v1 |
| 17 ; CHECK-NEXT: %_v0 = load i32* {{.*}}, align 1 |
| 18 |
| 19 %v2.asptr = inttoptr i32 %v2 to i32* |
| 20 %_v1 = load i32* %v2.asptr, align 1 |
| 21 %gep = add i32 %v2, 12 |
| 22 %gep.asptr = inttoptr i32 %gep to i32* |
| 23 %_v2 = load i32* %gep.asptr, align 1 |
| 24 %mul = mul i32 %_v2, %_v1 |
| 25 %gep6 = add i32 %v1, 4 |
| 26 %gep6.asptr = inttoptr i32 %gep6 to i32* |
| 27 %_v3 = load i32* %gep6.asptr, align 1 |
| 28 %gep8 = add i32 %v2, 8 |
| 29 %gep8.asptr = inttoptr i32 %gep8 to i32* |
| 30 %_v4 = load i32* %gep8.asptr, align 1 |
| 31 %gep10 = add i32 %v2, 4 |
| 32 %gep10.asptr = inttoptr i32 %gep10 to i32* |
| 33 %_v5 = load i32* %gep10.asptr, align 1 |
| 34 %mul3 = mul i32 %_v5, %_v4 |
| 35 %gep12 = add i32 %v1, 8 |
| 36 %gep12.asptr = inttoptr i32 %gep12 to i32* |
| 37 %_v6 = load i32* %gep12.asptr, align 1 |
| 38 %mul7 = mul i32 %_v6, %_v3 |
| 39 %mul9 = mul i32 %mul7, %_v6 |
| 40 %gep14 = add i32 %v1, 12 |
| 41 %gep14.asptr = inttoptr i32 %gep14 to i32* |
| 42 %_v7 = load i32* %gep14.asptr, align 1 |
| 43 %mul11 = mul i32 %mul9, %_v7 |
| 44 %add4.neg = add i32 %mul, %_v0 |
| 45 %add = sub i32 %add4.neg, %_v3 |
| 46 %sub = sub i32 %add, %mul3 |
| 47 %sub12 = sub i32 %sub, %mul11 |
| 48 ret i32 %sub12 |
| 49 |
| 50 ; CHECK: %sub12 = sub i32 %sub, %mul11 |
| 51 ; CHECK-NEXT: ret i32 %sub12 |
| 52 } |
| 53 |
| 54 ; ERRORS-NOT: ICE translation error |
| 55 ; DUMP-NOT: SZ |
OLD | NEW |