1 ; RUN: llc -asm-verbose=false -mtriple=x86_64-apple-darwin -o - < %s | FileCheck %s
3 ; LSR should leave non-affine expressions alone because it currently
4 ; doesn't know how to do anything with them, and when it tries, it
5 ; gets SCEVExpander's current expansion for them, which is suboptimal.
7 ; CHECK: xorl %eax, %eax
10 ; CHECK-NEXT: movq %rax, (%rdx)
11 ; CHECK-NEXT: addq %rsi, %rax
12 ; CHECK-NEXT: cmpq %rdi, %rax
14 ; CHECK-NEXT: imulq %rax, %rax
16 define i64 @foo(i64 %n, i64 %s, i64* %p) nounwind {
21 %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
22 store volatile i64 %i, i64* %p
23 %i.next = add i64 %i, %s
24 %c = icmp slt i64 %i.next, %n
25 br i1 %c, label %loop, label %exit
28 %mul = mul i64 %i.next, %i.next