brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 28c66b9 Raw
71 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=LINUX3; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s --check-prefixes=WIN4; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s --check-prefixes=LINUX5 6define i32 @test1(i32 %x) nounwind {7; LINUX-LABEL: test1:8; LINUX:       # %bb.0:9; LINUX-NEXT:    # kill: def $edi killed $edi def $rdi10; LINUX-NEXT:    leal 7(,%rdi,8), %eax11; LINUX-NEXT:    retq12;13; WIN-LABEL: test1:14; WIN:       # %bb.0:15; WIN-NEXT:    # kill: def $ecx killed $ecx def $rcx16; WIN-NEXT:    leal 7(,%rcx,8), %eax17; WIN-NEXT:    retq18  %tmp1 = shl i32 %x, 319  %tmp2 = add i32 %tmp1, 720  ret i32 %tmp221}22 23 24; ISel the add of -4 with a neg and use an lea for the rest of the25; arithmetic.26define i32 @test2(i32 %x_offs) nounwind readnone {27; LINUX-LABEL: test2:28; LINUX:       # %bb.0: # %entry29; LINUX-NEXT:    # kill: def $edi killed $edi def $rdi30; LINUX-NEXT:    cmpl $5, %edi31; LINUX-NEXT:    jl .LBB1_232; LINUX-NEXT:  # %bb.1: # %bb.nph33; LINUX-NEXT:    leal -5(%rdi), %eax34; LINUX-NEXT:    andl $-4, %eax35; LINUX-NEXT:    negl %eax36; LINUX-NEXT:    leal -4(%rdi,%rax), %eax37; LINUX-NEXT:    retq38; LINUX-NEXT:  .LBB1_2: # %bb239; LINUX-NEXT:    movl %edi, %eax40; LINUX-NEXT:    retq41;42; WIN-LABEL: test2:43; WIN:       # %bb.0: # %entry44; WIN-NEXT:    # kill: def $ecx killed $ecx def $rcx45; WIN-NEXT:    cmpl $5, %ecx46; WIN-NEXT:    jl .LBB1_247; WIN-NEXT:  # %bb.1: # %bb.nph48; WIN-NEXT:    leal -5(%rcx), %eax49; WIN-NEXT:    andl $-4, %eax50; WIN-NEXT:    negl %eax51; WIN-NEXT:    leal -4(%rcx,%rax), %eax52; WIN-NEXT:    retq53; WIN-NEXT:  .LBB1_2: # %bb254; WIN-NEXT:    movl %ecx, %eax55; WIN-NEXT:    retq56entry:57  %t0 = icmp sgt i32 %x_offs, 458  br i1 %t0, label %bb.nph, label %bb259 60bb.nph:61  %tmp = add i32 %x_offs, -562  %tmp6 = lshr i32 %tmp, 263  %tmp7 = mul i32 %tmp6, -464  %tmp8 = add i32 %tmp7, %x_offs65  %tmp9 = add i32 %tmp8, -466  ret i32 %tmp967 68bb2:69  ret i32 %x_offs70}71