1 ; RUN: opt -licm -enable-mssa-loop-dependency -verify-memoryssa -S < %s | FileCheck %s
4 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
5 target triple = "systemz-unknown"
7 @g_120 = external dso_local local_unnamed_addr global [8 x [4 x [6 x i32]]], align 4
8 @g_185 = external dso_local local_unnamed_addr global i32, align 4
9 @g_329 = external dso_local local_unnamed_addr global i16, align 2
11 ; Function Attrs: norecurse noreturn nounwind
12 define dso_local void @func_65() local_unnamed_addr {
13 ; CHECK-LABEL: @func_65()
17 label1: ; preds = %.thread, %label0
20 label2: ; preds = %.critedge, %label1
23 label3: ; preds = %label5, %label2
24 %storemerge = phi i32 [ 0, %label2 ], [ %tmp6, %label5 ]
25 store i32 %storemerge, i32* @g_185, align 4
26 %tmp4 = icmp ult i32 %storemerge, 2
27 br i1 %tmp4, label %label5, label %.thread.loopexit
29 label5: ; preds = %label3
30 %tmp6 = add i32 %storemerge, 1
31 %tmp7 = zext i32 %tmp6 to i64
32 %tmp8 = getelementptr [8 x [4 x [6 x i32]]], [8 x [4 x [6 x i32]]]* @g_120, i64 0, i64 undef, i64 %tmp7, i64 undef
33 %tmp9 = load i32, i32* %tmp8, align 4
34 %tmp10 = icmp eq i32 %tmp9, 0
35 br i1 %tmp10, label %label3, label %label11
37 label11: ; preds = %label5
38 %storemerge.lcssa4 = phi i32 [ %storemerge, %label5 ]
39 %tmp12 = icmp eq i32 %storemerge.lcssa4, 0
40 br i1 %tmp12, label %.critedge, label %.thread.loopexit3
42 .critedge: ; preds = %label11
43 store i16 0, i16* @g_329, align 2
46 .thread.loopexit: ; preds = %label3
49 .thread.loopexit3: ; preds = %label11
52 .thread: ; preds = %.thread.loopexit3, %.thread.loopexit