2 ; RUN: opt -passes='loop-mssa(loop-rotate,licm)' %s -disable-output -debug-only=licm 2>&1 | FileCheck %s -check-prefix=LICM
3 ; RUN: opt -passes='loop-mssa(loop-rotate,licm)' %s -S | FileCheck %s
5 ; LICM-NOT: LICM sinking instruction: %.pre = load i8, ptr %arrayidx.phi.trans.insert
9 ; CHECK: br i1 true, label %[[END:.*]], label %[[PH:.*]]
11 ; CHECK: br label %[[CRIT:.*]]
15 ; CHECK: br i1 true, label %[[ENDCRIT:.*]], label %[[CRIT]]
18 ; CHECK: br label %[[END]]
20 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"
21 target triple = "s390x-unknown-linux-gnu"
25 %g = alloca [9 x i8], align 1
28 for.body: ; preds = %for.body.for.body_crit_edge, %entry
29 %0 = phi i64 [ 0, %entry ], [ %phitmp, %for.body.for.body_crit_edge ]
30 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body.for.body_crit_edge ]
31 %arrayidx = getelementptr inbounds [9 x i8], ptr %g, i64 0, i64 %indvars.iv
32 store i8 2, ptr %arrayidx, align 1
33 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
34 br i1 undef, label %for.end18, label %for.body.for.body_crit_edge
36 for.body.for.body_crit_edge: ; preds = %for.body
37 %arrayidx.phi.trans.insert = getelementptr inbounds [9 x i8], ptr %g, i64 0, i64 %indvars.iv.next
38 %.pre = load i8, ptr %arrayidx.phi.trans.insert, align 1
39 %phitmp = zext i8 %.pre to i64
42 for.end18: ; preds = %for.body
43 store i64 %0, ptr undef, align 8