82 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s3 4define i1 @foo(i32 %i) optsize {5; CHECK-LABEL: foo:6; CHECK: # %bb.0:7; CHECK-NEXT: notl %edi8; CHECK-NEXT: testl $305419896, %edi # imm = 0x123456789; CHECK-NEXT: sete %al10; CHECK-NEXT: retq11 %and = and i32 %i, 30541989612 %cmp = icmp eq i32 %and, 30541989613 ret i1 %cmp14}15 16define i1 @foo_pgso(i32 %i) !prof !14 {17; CHECK-LABEL: foo_pgso:18; CHECK: # %bb.0:19; CHECK-NEXT: notl %edi20; CHECK-NEXT: testl $305419896, %edi # imm = 0x1234567821; CHECK-NEXT: sete %al22; CHECK-NEXT: retq23 %and = and i32 %i, 30541989624 %cmp = icmp eq i32 %and, 30541989625 ret i1 %cmp26}27 28; 8-bit ALU immediates probably have small encodings.29; We do not want to hoist the constant into a register here.30 31define zeroext i1 @g(i32 %x) optsize {32; CHECK-LABEL: g:33; CHECK: # %bb.0:34; CHECK-NEXT: testl $-2, %edi35; CHECK-NEXT: sete %al36; CHECK-NEXT: retq37 %t0 = or i32 %x, 138 %t1 = icmp eq i32 %t0, 139 ret i1 %t140}41 42; 8-bit ALU immediates probably have small encodings.43; We do not want to hoist the constant into a register here.44 45define i64 @PR46237(i64 %x, i64 %y, i64 %z) optsize {46; CHECK-LABEL: PR46237:47; CHECK: # %bb.0:48; CHECK-NEXT: movl %edx, %eax49; CHECK-NEXT: shll $6, %eax50; CHECK-NEXT: movzbl %al, %ecx51; CHECK-NEXT: andl $7, %esi52; CHECK-NEXT: andl $7, %edx53; CHECK-NEXT: leaq (%rdx,%rsi,8), %rax54; CHECK-NEXT: orq %rcx, %rax55; CHECK-NEXT: retq56 %and = shl i64 %z, 657 %shl = and i64 %and, 19258 %and1 = shl i64 %y, 359 %shl2 = and i64 %and1, 5660 %and3 = and i64 %z, 761 %or = or i64 %and3, %shl262 %or4 = or i64 %or, %shl63 ret i64 %or464}65 66!llvm.module.flags = !{!0}67!0 = !{i32 1, !"ProfileSummary", !1}68!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}69!2 = !{!"ProfileFormat", !"InstrProf"}70!3 = !{!"TotalCount", i64 10000}71!4 = !{!"MaxCount", i64 10}72!5 = !{!"MaxInternalCount", i64 1}73!6 = !{!"MaxFunctionCount", i64 1000}74!7 = !{!"NumCounts", i64 3}75!8 = !{!"NumFunctions", i64 3}76!9 = !{!"DetailedSummary", !10}77!10 = !{!11, !12, !13}78!11 = !{i32 10000, i64 100, i32 1}79!12 = !{i32 999000, i64 100, i32 1}80!13 = !{i32 999999, i64 1, i32 2}81!14 = !{!"function_entry_count", i64 0}82