1 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
4 ; The comparison uses the pre-inc value, which could lead LSR to
5 ; try to compute -INT64_MIN.
7 ; CHECK: movabsq $-9223372036854775808, %rax
13 define i1 @foo() nounwind {
18 %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.cond.i ]
20 %indvar.next = add i64 %indvar, 1
21 %s = icmp ne i64 %indvar.next, %t
22 br i1 %s, label %for.cond.i, label %__ABContainsLabel.exit
24 __ABContainsLabel.exit:
25 %cmp = icmp eq i64 %indvar, 9223372036854775807
29 define void @func_37() noreturn nounwind readonly {
33 for.body: ; preds = %for.inc8, %entry
34 %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.inc8 ]
35 %sub.i = add i64 undef, %indvar
36 %cmp.i = icmp eq i64 %sub.i, -9223372036854775808
37 br i1 undef, label %for.inc8, label %for.cond4
39 for.cond4: ; preds = %for.cond4, %for.body
42 for.inc8: ; preds = %for.body
43 %indvar.next = add i64 %indvar, 1