1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-unknown-linux -enable-misched=false | FileCheck %s 3 4;; Simple case 5define i32 @test1(i8 %x) nounwind readnone { 6; CHECK-LABEL: test1: 7; CHECK: # %bb.0: 8; CHECK-NEXT: movzbl {{[0-9]+}}(%esp), %eax 9; CHECK-NEXT: andl $-32, %eax 10; CHECK-NEXT: retl 11 %A = and i8 %x, -32 12 %B = zext i8 %A to i32 13 ret i32 %B 14} 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), %eax 21; CHECK-NEXT: movl %eax, %ecx 22; CHECK-NEXT: andl $-32, %ecx 23; CHECK-NEXT: orl $63, %eax 24; CHECK-NEXT: addl %ecx, %eax 25; CHECK-NEXT: retl 26 %A = and i8 %x, -32 27 %B = zext i8 %A to i32 28 %C = or i8 %x, 63 29 %D = zext i8 %C to i32 30 %E = add i32 %B, %D 31 ret i32 %E 32} 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, %esp 41; CHECK-NEXT: movzbl {{[0-9]+}}(%esp), %eax 42; CHECK-NEXT: subl $8, %esp 43; CHECK-NEXT: pushl %eax 44; CHECK-NEXT: andl $-32, %eax 45; CHECK-NEXT: pushl %eax 46; CHECK-NEXT: calll use 47; CHECK-NEXT: addl $28, %esp 48; CHECK-NEXT: retl 49 %A = and i8 %x, -32 50 %B = zext i8 %A to i32 51 call void @use(i32 %B, i8 %x) 52 ret void 53} 54 55