1 ; RUN: opt < %s -loop-reduce -S | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
7 define void @not_addressing_mode(ptr %input, i64 %n) {
8 ; CHECK-LABEL: @not_addressing_mode(
14 ; CHECK: %lsr.iv = phi ptr [ {{%[^,]+}}, %loop ], [ %input, %entry ]
15 %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
16 %i.next = add i64 %i, 1
18 ; (%input - 2 * %j) is not foldable. Worth another indvar.
19 %p = getelementptr i8, ptr %input, i64 %j
21 ; CHECK: %v = load i8, ptr %lsr.iv
23 %exitcond = icmp slt i64 %i.next, %n
24 br i1 %exitcond, label %exit, label %loop