Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
      2 ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
      3 ; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
      4 ; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s
      5 
      6 define i32 @test1(i32 %x) nounwind {
      7         %tmp1 = shl i32 %x, 3
      8         %tmp2 = add i32 %tmp1, 7
      9         ret i32 %tmp2
     10 ; CHECK-LABEL: test1:
     11 ; CHECK:    leal 7(,%r[[A0:di|cx]],8), %eax
     12 }
     13 
     14 
     15 ; ISel the add of -4 with a neg and use an lea for the rest of the
     16 ; arithemtic.
     17 define i32 @test2(i32 %x_offs) nounwind readnone {
     18 entry:
     19 	%t0 = icmp sgt i32 %x_offs, 4
     20 	br i1 %t0, label %bb.nph, label %bb2
     21 
     22 bb.nph:
     23 	%tmp = add i32 %x_offs, -5
     24 	%tmp6 = lshr i32 %tmp, 2
     25 	%tmp7 = mul i32 %tmp6, -4
     26 	%tmp8 = add i32 %tmp7, %x_offs
     27 	%tmp9 = add i32 %tmp8, -4
     28 	ret i32 %tmp9
     29 
     30 bb2:
     31 	ret i32 %x_offs
     32 ; CHECK-LABEL: test2:
     33 ; CHECK:        leal    -5(%r[[A0:..]]), %eax
     34 ; CHECK:	andl	$-4, %eax
     35 ; CHECK:	negl	%eax
     36 ; CHECK:	leal	-4(%r[[A0]],%rax), %eax
     37 }
     38