1 ; RUN: llvm-as < %s | llc -march=x86-64 > %t
2 ; RUN: grep negl %t | count 1
3 ; RUN: not grep {sub\[bwlq\]} %t
4 ; RUN: grep mov %t | count 1
5 ; RUN: grep {leal -4(} %t | count 1
7 ; ISel the add of -4 with a neg and use an lea for the rest of the
10 define i32 @test(i32 %x_offs) nounwind readnone {
12 %t0 = icmp sgt i32 %x_offs, 4 ; <i1> [#uses=1]
13 br i1 %t0, label %bb.nph, label %bb2
15 bb.nph: ; preds = %entry
16 %tmp = add i32 %x_offs, -5 ; <i32> [#uses=1]
17 %tmp6 = lshr i32 %tmp, 2 ; <i32> [#uses=1]
18 %tmp7 = mul i32 %tmp6, -4 ; <i32> [#uses=1]
19 %tmp8 = add i32 %tmp7, %x_offs ; <i32> [#uses=1]
20 %tmp9 = add i32 %tmp8, -4 ; <i32> [#uses=1]