1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -indvars < %s | FileCheck %s
4 target datalayout = "E-m:e-i64:64-n32:64"
5 target triple = "powerpc64-unknown-linux-gnu"
7 define void @f(i32* %end.s, i8** %loc, i32 %p) {
10 ; CHECK-NEXT: [[END:%.*]] = getelementptr i32, i32* [[END_S:%.*]], i32 [[P:%.*]]
11 ; CHECK-NEXT: br label [[WHILE_BODY_I:%.*]]
12 ; CHECK: while.body.i:
13 ; CHECK-NEXT: br i1 true, label [[LOOP_EXIT:%.*]], label [[WHILE_BODY_I]]
15 ; CHECK-NEXT: [[END1:%.*]] = bitcast i32* [[END]] to i8*
16 ; CHECK-NEXT: store i8* [[END1]], i8** [[LOC:%.*]], align 8
17 ; CHECK-NEXT: ret void
20 %end = getelementptr inbounds i32, i32* %end.s, i32 %p
21 %init = bitcast i32* %end.s to i8*
22 br label %while.body.i
25 %ptr = phi i8* [ %ptr.inc, %while.body.i ], [ %init, %entry ]
26 %ptr.inc = getelementptr inbounds i8, i8* %ptr, i8 1
27 %ptr.inc.cast = bitcast i8* %ptr.inc to i32*
28 %cmp.i = icmp eq i32* %ptr.inc.cast, %end
29 br i1 %cmp.i, label %loop.exit, label %while.body.i
32 %ptr.inc.lcssa = phi i8* [ %ptr.inc, %while.body.i ]
33 store i8* %ptr.inc.lcssa, i8** %loc