1 ; RUN: opt < %s -loop-reduce -S | FileCheck %s
2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-windows-msvc"
5 define void @f() personality ptr @__CxxFrameHandler3 {
9 for.cond.i: ; preds = %for.inc.i, %entry
10 %_First.addr.0.i = phi ptr [ null, %entry ], [ %incdec.ptr.i, %for.inc.i ]
12 to label %for.inc.i unwind label %catch.dispatch.i
14 catch.dispatch.i: ; preds = %for.cond.i
15 %cs = catchswitch within none [label %for.cond.1.preheader.i] unwind to caller
17 for.cond.1.preheader.i: ; preds = %catch.dispatch.i
18 %0 = catchpad within %cs [ptr null, i32 64, ptr null]
19 %cmp.i = icmp eq ptr %_First.addr.0.i, null
20 br label %for.cond.1.i
22 for.cond.1.i: ; preds = %for.body.i, %for.cond.1.preheader.i
23 br i1 %cmp.i, label %for.end.i, label %for.body.i
25 for.body.i: ; preds = %for.cond.1.i
27 br label %for.cond.1.i
29 for.inc.i: ; preds = %for.cond.i
30 %incdec.ptr.i = getelementptr inbounds i32, ptr %_First.addr.0.i, i64 1
33 for.end.i: ; preds = %for.cond.1.i
34 catchret from %0 to label %leave
36 leave: ; preds = %for.end.i
40 ; CHECK-LABEL: define void @f(
41 ; CHECK: %[[PHI:.*]] = phi i64 [ %[[IV_NEXT:.*]], {{.*}} ], [ 0, {{.*}} ]
42 ; CHECK: %[[ITOP:.*]] = inttoptr i64 %[[PHI]] to ptr
43 ; CHECK: %[[CMP:.*]] = icmp eq ptr %[[ITOP]], null
44 ; CHECK: %[[IV_NEXT]] = add i64 %[[PHI]], -4
48 declare i32 @__CxxFrameHandler3(...)