1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=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(ptr %end.s, ptr %loc, i32 %p) {
10 ; CHECK-NEXT: br label [[WHILE_BODY_I:%.*]]
11 ; CHECK: while.body.i:
12 ; CHECK-NEXT: br i1 true, label [[LOOP_EXIT:%.*]], label [[WHILE_BODY_I]]
14 ; CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i32, ptr [[END_S:%.*]], i32 [[P:%.*]]
15 ; CHECK-NEXT: store ptr [[END]], ptr [[LOC:%.*]], align 8
16 ; CHECK-NEXT: ret void
19 %end = getelementptr inbounds i32, ptr %end.s, i32 %p
20 br label %while.body.i
23 %ptr = phi ptr [ %ptr.inc, %while.body.i ], [ %end.s, %entry ]
24 %ptr.inc = getelementptr inbounds i8, ptr %ptr, i8 1
25 %cmp.i = icmp eq ptr %ptr.inc, %end
26 br i1 %cmp.i, label %loop.exit, label %while.body.i
29 %ptr.inc.lcssa = phi ptr [ %ptr.inc, %while.body.i ]
30 store ptr %ptr.inc.lcssa, ptr %loc