1 ; RUN: opt < %s -basic-aa -da -analyze -enable-new-pm=0 -delinearize
2 ; RUN: opt < %s -aa-pipeline=basic-aa -passes='require<da>,print<delinearization>' -disable-output
21 @g = common global i32 0, align 4
22 @h = common global i32 0, align 4
23 @f = common global i8* null, align 4
24 @a = common global i32 0, align 4
25 @b = common global i32 0, align 4
26 @c = common global i32 0, align 4
27 @d = common global i32 0, align 4
31 %.pr = load i32, i32* @d, align 4
32 %phitmp = icmp eq i32 %.pr, 0
36 %0 = phi i1 [ true, %for.cond ], [ %phitmp, %entry ]
37 br i1 %0, label %for.cond, label %for.cond2thread-pre-split.preheader.i
39 for.cond2thread-pre-split.preheader.i:
40 %1 = load i32, i32* @g, align 4
41 %2 = load i32, i32* @h, align 4
42 %mul = mul nsw i32 %2, %1
43 %3 = load i8*, i8** @f, align 4
44 %.pr.pre.i = load i32, i32* @b, align 4
45 br label %for.cond2thread-pre-split.i
47 for.cond2thread-pre-split.i:
48 %.pr.i = phi i32 [ 0, %for.inc5.i ], [ %.pr.pre.i, %for.cond2thread-pre-split.preheader.i ]
49 %storemerge.i = phi i32 [ %inc6.i, %for.inc5.i ], [ 0, %for.cond2thread-pre-split.preheader.i ]
50 store i32 %storemerge.i, i32* @a, align 4
51 %tobool31.i = icmp eq i32 %.pr.i, 0
52 br i1 %tobool31.i, label %for.inc5.i, label %for.body4.preheader.i
54 for.body4.preheader.i:
55 %4 = icmp slt i32 %.pr.i, -7
56 %add.i = add i32 %storemerge.i, %mul
57 br i1 %4, label %for.body4.i.preheader, label %for.body4.ur.i.preheader
59 for.body4.i.preheader:
60 %5 = sub i32 -8, %.pr.i
66 %8 = phi i32 [ %inc.7.i, %for.body4.i ], [ %.pr.i, %for.body4.i.preheader ]
67 %arrayidx.sum1 = add i32 %add.i, %8
68 %arrayidx.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum1
69 %9 = load i8, i8* %arrayidx.i, align 1
70 %conv.i = sext i8 %9 to i32
71 store i32 %conv.i, i32* @c, align 4
72 %inc.i = add nsw i32 %8, 1
73 store i32 %inc.i, i32* @b, align 4
74 %arrayidx.sum2 = add i32 %add.i, %inc.i
75 %arrayidx.1.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum2
76 %10 = load i8, i8* %arrayidx.1.i, align 1
77 %conv.1.i = sext i8 %10 to i32
78 store i32 %conv.1.i, i32* @c, align 4
79 %inc.1.i = add nsw i32 %8, 2
80 store i32 %inc.1.i, i32* @b, align 4
81 %arrayidx.sum3 = add i32 %add.i, %inc.1.i
82 %arrayidx.2.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum3
83 %11 = load i8, i8* %arrayidx.2.i, align 1
84 %conv.2.i = sext i8 %11 to i32
85 store i32 %conv.2.i, i32* @c, align 4
86 %inc.2.i = add nsw i32 %8, 3
87 store i32 %inc.2.i, i32* @b, align 4
88 %arrayidx.sum4 = add i32 %add.i, %inc.2.i
89 %arrayidx.3.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum4
90 %12 = load i8, i8* %arrayidx.3.i, align 1
91 %conv.3.i = sext i8 %12 to i32
92 store i32 %conv.3.i, i32* @c, align 4
93 %inc.3.i = add nsw i32 %8, 4
94 store i32 %inc.3.i, i32* @b, align 4
95 %arrayidx.sum5 = add i32 %add.i, %inc.3.i
96 %arrayidx.4.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum5
97 %13 = load i8, i8* %arrayidx.4.i, align 1
98 %conv.4.i = sext i8 %13 to i32
99 store i32 %conv.4.i, i32* @c, align 4
100 %inc.4.i = add nsw i32 %8, 5
101 store i32 %inc.4.i, i32* @b, align 4
102 %arrayidx.sum6 = add i32 %add.i, %inc.4.i
103 %arrayidx.5.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum6
104 %14 = load i8, i8* %arrayidx.5.i, align 1
105 %conv.5.i = sext i8 %14 to i32
106 store i32 %conv.5.i, i32* @c, align 4
107 %inc.5.i = add nsw i32 %8, 6
108 store i32 %inc.5.i, i32* @b, align 4
109 %arrayidx.sum7 = add i32 %add.i, %inc.5.i
110 %arrayidx.6.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum7
111 %15 = load i8, i8* %arrayidx.6.i, align 1
112 %conv.6.i = sext i8 %15 to i32
113 store i32 %conv.6.i, i32* @c, align 4
114 %inc.6.i = add nsw i32 %8, 7
115 store i32 %inc.6.i, i32* @b, align 4
116 %arrayidx.sum8 = add i32 %add.i, %inc.6.i
117 %arrayidx.7.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum8
118 %16 = load i8, i8* %arrayidx.7.i, align 1
119 %conv.7.i = sext i8 %16 to i32
120 store i32 %conv.7.i, i32* @c, align 4
121 %inc.7.i = add nsw i32 %8, 8
122 store i32 %inc.7.i, i32* @b, align 4
123 %tobool3.7.i = icmp sgt i32 %inc.7.i, -8
124 br i1 %tobool3.7.i, label %for.inc5.loopexit.ur-lcssa.i, label %for.body4.i
126 for.inc5.loopexit.ur-lcssa.i:
127 %17 = add i32 %.pr.i, 8
128 %18 = add i32 %17, %7
129 %19 = icmp eq i32 %18, 0
130 br i1 %19, label %for.inc5.i, label %for.body4.ur.i.preheader
132 for.body4.ur.i.preheader:
133 %.ph = phi i32 [ %18, %for.inc5.loopexit.ur-lcssa.i ], [ %.pr.i, %for.body4.preheader.i ]
134 br label %for.body4.ur.i
137 %20 = phi i32 [ %inc.ur.i, %for.body4.ur.i ], [ %.ph, %for.body4.ur.i.preheader ]
138 %arrayidx.sum = add i32 %add.i, %20
139 %arrayidx.ur.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum
140 %21 = load i8, i8* %arrayidx.ur.i, align 1
141 %conv.ur.i = sext i8 %21 to i32
142 store i32 %conv.ur.i, i32* @c, align 4
143 %inc.ur.i = add nsw i32 %20, 1
144 store i32 %inc.ur.i, i32* @b, align 4
145 %tobool3.ur.i = icmp eq i32 %inc.ur.i, 0
146 br i1 %tobool3.ur.i, label %for.inc5.i.loopexit, label %for.body4.ur.i
152 %inc6.i = add nsw i32 %storemerge.i, 1
153 br label %for.cond2thread-pre-split.i