1 ; RUN: opt -S -passes='require<domtree>,loop(loop-simplifycfg)' < %s | FileCheck %s
2 ; RUN: opt -S -passes=loop-simplifycfg -verify-memoryssa < %s | FileCheck %s
6 ; CHECK-NEXT: br label %[[LOOP:[a-z]+]]
11 define i32 @foo(ptr %P, ptr %Q) {
15 outer: ; preds = %outer.latch2, %entry
16 %y.2 = phi i32 [ 0, %entry ], [ %y.inc2, %outer.latch2 ]
19 inner: ; preds = %outer
23 %y.inc2 = add nsw i32 %y.2, 1
24 %exitcond.outer = icmp eq i32 %y.inc2, 3
25 store i32 %y.2, ptr %P
26 br i1 %exitcond.outer, label %exit, label %outer.latch2
28 outer.latch2: ; preds = %inner
29 %t = sext i32 %y.inc2 to i64
33 exit: ; preds = %inner