1; RUN: opt < %s -loop-reduce -S | FileCheck %s 2 3target 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" 4 5declare void @foo(i8) 6 7define void @not_addressing_mode(i8* %input, i64 %n) { 8; CHECK-LABEL: @not_addressing_mode( 9entry: 10 br label %loop 11 12loop: 13; CHECK: loop: 14; CHECK: %lsr.iv = phi i8* [ {{%[^,]+}}, %loop ], [ %input, %entry ] 15 %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] 16 %i.next = add i64 %i, 1 17 %j = mul i64 %i, -2 18 ; (%input - 2 * %j) is not foldable. Worth another indvar. 19 %p = getelementptr i8, i8* %input, i64 %j 20 %v = load i8, i8* %p 21; CHECK: %v = load i8, i8* %lsr.iv 22 call void @foo(i8 %v) 23 %exitcond = icmp slt i64 %i.next, %n 24 br i1 %exitcond, label %exit, label %loop 25 26exit: 27 ret void 28} 29