|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s |
| 3 | + |
| 4 | +define void @constant_expressions() { |
| 5 | +; CHECK-LABEL: constant_expressions: |
| 6 | +; CHECK: # %bb.0: # %entry |
| 7 | +; CHECK-NEXT: movl -289477652, %eax |
| 8 | +; CHECK-NEXT: movl -289477644, %ecx |
| 9 | +; CHECK-NEXT: addl -289477648, %eax |
| 10 | +; CHECK-NEXT: addl -289477636, %ecx |
| 11 | +; CHECK-NEXT: addl %eax, %ecx |
| 12 | +; CHECK-NEXT: movl %ecx, -289477652 |
| 13 | +; CHECK-NEXT: retq |
| 14 | +entry: |
| 15 | + %0 = load i32, i32* inttoptr (i32 add (i32 -289477652, i32 0) to i32*) |
| 16 | + %1 = load i32, i32* inttoptr (i32 add (i32 -289477652, i32 4) to i32*) |
| 17 | + %2 = load i32, i32* inttoptr (i32 add (i32 -289477652, i32 8) to i32*) |
| 18 | + %3 = load i32, i32* inttoptr (i32 add (i32 -289477652, i32 16) to i32*) |
| 19 | + %4 = add i32 %0, %1 |
| 20 | + %5 = add i32 %2, %3 |
| 21 | + %6 = add i32 %4, %5 |
| 22 | + store i32 %6, i32* inttoptr (i32 add (i32 -289477652, i32 0) to i32*) |
| 23 | + ret void |
| 24 | +} |
| 25 | + |
| 26 | + |
| 27 | +define void @constant_expressions2() { |
| 28 | +; CHECK-LABEL: constant_expressions2: |
| 29 | +; CHECK: # %bb.0: # %entry |
| 30 | +; CHECK-NEXT: movl -289477652, %eax |
| 31 | +; CHECK-NEXT: movl -289477644, %ecx |
| 32 | +; CHECK-NEXT: addl -289477648, %eax |
| 33 | +; CHECK-NEXT: addl -289477640, %ecx |
| 34 | +; CHECK-NEXT: addl %eax, %ecx |
| 35 | +; CHECK-NEXT: movl %ecx, -289477652 |
| 36 | +; CHECK-NEXT: retq |
| 37 | +entry: |
| 38 | + %0 = load i32, i32* inttoptr (i32 -289477652 to i32*) |
| 39 | + %1 = load i32, i32* inttoptr (i32 -289477648 to i32*) |
| 40 | + %2 = load i32, i32* inttoptr (i32 -289477644 to i32*) |
| 41 | + %3 = load i32, i32* inttoptr (i32 -289477640 to i32*) |
| 42 | + %4 = add i32 %0, %1 |
| 43 | + %5 = add i32 %2, %3 |
| 44 | + %6 = add i32 %4, %5 |
| 45 | + store i32 %6, i32* inttoptr (i32 -289477652 to i32*) |
| 46 | + ret void |
| 47 | +} |
0 commit comments