1 ; RUN: llvm-as < %s | llc -march=x86-64 | FileCheck %s
3 define i32 @test1(i32 %x) nounwind {
5 %tmp2 = add i32 %tmp1, 7
8 ; CHECK: leal 7(,%rdi,8), %eax
12 ; ISel the add of -4 with a neg and use an lea for the rest of the
14 define i32 @test2(i32 %x_offs) nounwind readnone {
16 %t0 = icmp sgt i32 %x_offs, 4
17 br i1 %t0, label %bb.nph, label %bb2
20 %tmp = add i32 %x_offs, -5
21 %tmp6 = lshr i32 %tmp, 2
22 %tmp7 = mul i32 %tmp6, -4
23 %tmp8 = add i32 %tmp7, %x_offs
24 %tmp9 = add i32 %tmp8, -4
30 ; CHECK: leal -5(%rdi), %eax
31 ; CHECK: andl $-4, %eax
33 ; CHECK: leal -4(%rdi,%rax), %eax