blob: 551bd03f0ae3fbefe6c37e3bc49c31e28a283174 [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
Mehdi Amini46a43552015-03-04 18:43:29 +00007; Provide legal integer types.
8; Declare i2 as legal so that IVUsers accepts to consider %indvar3451
9target datalayout = "n2:8:16:32:64"
10
Dan Gohman90598332010-01-12 04:52:47 +000011define void @Fill_Buffer(i2* %p) nounwind {
Dan Gohman72489232009-05-20 00:34:08 +000012entry:
13 br label %bb8
14
15bb8:
16 %indvar34 = phi i32 [ 0, %entry ], [ %indvar.next35, %bb8 ]
17 %indvar3451 = trunc i32 %indvar34 to i2
David Blaikiea79ac142015-02-27 21:17:42 +000018 %xmp4344 = load i2, i2* %p
Dan Gohman72489232009-05-20 00:34:08 +000019 %xmp104 = icmp eq i2 %indvar3451, %xmp4344
20 %indvar.next35 = add i32 %indvar34, 1
21 br i1 %xmp104, label %bb10, label %bb8
22
23bb10:
24 unreachable
25}