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