Dan Gohman | 968cb93 | 2010-02-17 00:41:53 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86-64 | FileCheck %s |
| 2 | |
| 3 | ; The comparison uses the pre-inc value, which could lead LSR to |
| 4 | ; try to compute -INT64_MIN. |
| 5 | |
Dan Gohman | 2a5431e | 2010-02-17 01:08:57 +0000 | [diff] [blame^] | 6 | ; CHECK: movabsq $-9223372036854775808, %rax |
Dan Gohman | 968cb93 | 2010-02-17 00:41:53 +0000 | [diff] [blame] | 7 | ; CHECK: cmpq %rax, %rbx |
| 8 | ; CHECK: sete %al |
| 9 | |
| 10 | declare i64 @bar() |
| 11 | |
| 12 | define i1 @foo() nounwind { |
| 13 | entry: |
| 14 | br label %for.cond.i |
| 15 | |
| 16 | for.cond.i: |
| 17 | %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.cond.i ] |
| 18 | %t = call i64 @bar() |
| 19 | %indvar.next = add i64 %indvar, 1 |
| 20 | %s = icmp ne i64 %indvar.next, %t |
| 21 | br i1 %s, label %for.cond.i, label %__ABContainsLabel.exit |
| 22 | |
| 23 | __ABContainsLabel.exit: |
| 24 | %cmp = icmp eq i64 %indvar, 9223372036854775807 |
| 25 | ret i1 %cmp |
| 26 | } |