blob: 4809def86ae33710c5fe8ad690c394b14398f727 [file] [log] [blame]
Dan Gohman18800922009-09-11 18:01:28 +00001; RUN: opt < %s -loop-reduce -S \
Chandler Carrutha5a29f92012-07-02 12:47:22 +00002; RUN: | grep "icmp eq i2 %lsr.iv.next, %xmp4344"
Dan Gohman72489232009-05-20 00:34:08 +00003
4; Don't reverse the iteration if the rhs of the compare is defined
5; inside the loop.
6
Dan Gohman90598332010-01-12 04:52:47 +00007define void @Fill_Buffer(i2* %p) nounwind {
Dan Gohman72489232009-05-20 00:34:08 +00008entry:
9 br label %bb8
10
11bb8:
12 %indvar34 = phi i32 [ 0, %entry ], [ %indvar.next35, %bb8 ]
13 %indvar3451 = trunc i32 %indvar34 to i2
David Blaikiea79ac142015-02-27 21:17:42 +000014 %xmp4344 = load i2, i2* %p
Dan Gohman72489232009-05-20 00:34:08 +000015 %xmp104 = icmp eq i2 %indvar3451, %xmp4344
16 %indvar.next35 = add i32 %indvar34, 1
17 br i1 %xmp104, label %bb10, label %bb8
18
19bb10:
20 unreachable
21}