brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · ad1ce14 Raw
55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown-linux -enable-misched=false | FileCheck %s3 4;; Simple case5define i32 @test1(i8 %x) nounwind readnone {6; CHECK-LABEL: test1:7; CHECK:       # %bb.0:8; CHECK-NEXT:    movzbl {{[0-9]+}}(%esp), %eax9; CHECK-NEXT:    andl $-32, %eax10; CHECK-NEXT:    retl11  %A = and i8 %x, -3212  %B = zext i8 %A to i3213  ret i32 %B14}15 16;; Multiple uses of %x but easily extensible.17define i32 @test2(i8 %x) nounwind readnone {18; CHECK-LABEL: test2:19; CHECK:       # %bb.0:20; CHECK-NEXT:    movzbl {{[0-9]+}}(%esp), %eax21; CHECK-NEXT:    movl %eax, %ecx22; CHECK-NEXT:    andl $-32, %ecx23; CHECK-NEXT:    orl $63, %eax24; CHECK-NEXT:    addl %ecx, %eax25; CHECK-NEXT:    retl26  %A = and i8 %x, -3227  %B = zext i8 %A to i3228  %C = or i8 %x, 6329  %D = zext i8 %C to i3230  %E = add i32 %B, %D31  ret i32 %E32}33 34declare void @use(i32, i8)35 36;; Multiple uses of %x where we shouldn't extend the load.37define void @test3(i8 %x) nounwind readnone {38; CHECK-LABEL: test3:39; CHECK:       # %bb.0:40; CHECK-NEXT:    subl $12, %esp41; CHECK-NEXT:    movzbl {{[0-9]+}}(%esp), %eax42; CHECK-NEXT:    subl $8, %esp43; CHECK-NEXT:    pushl %eax44; CHECK-NEXT:    andl $-32, %eax45; CHECK-NEXT:    pushl %eax46; CHECK-NEXT:    calll use@PLT47; CHECK-NEXT:    addl $28, %esp48; CHECK-NEXT:    retl49  %A = and i8 %x, -3250  %B = zext i8 %A to i3251  call void @use(i32 %B, i8 %x)52  ret void53}54 55