brintos

brintos / llvm-project-archived public Read only

0
0
Text · 71.7 KiB · 28e732b Raw
2426 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=cmov     | FileCheck %s --check-prefixes=X86,X86-NOSSE3; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse     | FileCheck %s --check-prefixes=X86,X86-SSE14; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2    | FileCheck %s --check-prefixes=X86,X86-SSE25; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.1  | FileCheck %s --check-prefixes=X86,X86-SSE416 7; This tests codegen time inlining/optimization of memcmp8; rdar://64803989 10@.str = private constant [513 x i8] c"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901\00", align 111 12declare dso_local i32 @memcmp(ptr, ptr, i32)13 14define i32 @length0(ptr %X, ptr %Y) nounwind {15; X86-LABEL: length0:16; X86:       # %bb.0:17; X86-NEXT:    xorl %eax, %eax18; X86-NEXT:    retl19   %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 0) nounwind20   ret i32 %m21 }22 23define i1 @length0_eq(ptr %X, ptr %Y) nounwind {24; X86-LABEL: length0_eq:25; X86:       # %bb.0:26; X86-NEXT:    movb $1, %al27; X86-NEXT:    retl28  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 0) nounwind29  %c = icmp eq i32 %m, 030  ret i1 %c31}32 33define i1 @length0_lt(ptr %X, ptr %Y) nounwind {34; X86-LABEL: length0_lt:35; X86:       # %bb.0:36; X86-NEXT:    xorl %eax, %eax37; X86-NEXT:    retl38  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 0) nounwind39  %c = icmp slt i32 %m, 040  ret i1 %c41}42 43define i32 @length2(ptr %X, ptr %Y) nounwind {44; X86-LABEL: length2:45; X86:       # %bb.0:46; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax47; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx48; X86-NEXT:    movzwl (%ecx), %ecx49; X86-NEXT:    movzwl (%eax), %edx50; X86-NEXT:    rolw $8, %cx51; X86-NEXT:    rolw $8, %dx52; X86-NEXT:    movzwl %cx, %eax53; X86-NEXT:    movzwl %dx, %ecx54; X86-NEXT:    subl %ecx, %eax55; X86-NEXT:    retl56  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 2) nounwind57  ret i32 %m58}59 60define i32 @length2_const(ptr %X, ptr %Y) nounwind {61; X86-LABEL: length2_const:62; X86:       # %bb.0:63; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax64; X86-NEXT:    movzwl (%eax), %eax65; X86-NEXT:    rolw $8, %ax66; X86-NEXT:    movzwl %ax, %eax67; X86-NEXT:    addl $-12594, %eax # imm = 0xCECE68; X86-NEXT:    retl69  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 2) nounwind70  ret i32 %m71}72 73define i1 @length2_gt_const(ptr %X, ptr %Y) nounwind {74; X86-LABEL: length2_gt_const:75; X86:       # %bb.0:76; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax77; X86-NEXT:    movzwl (%eax), %eax78; X86-NEXT:    rolw $8, %ax79; X86-NEXT:    movzwl %ax, %eax80; X86-NEXT:    addl $-12594, %eax # imm = 0xCECE81; X86-NEXT:    testl %eax, %eax82; X86-NEXT:    setg %al83; X86-NEXT:    retl84  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 2) nounwind85  %c = icmp sgt i32 %m, 086  ret i1 %c87}88 89define i1 @length2_eq(ptr %X, ptr %Y) nounwind {90; X86-LABEL: length2_eq:91; X86:       # %bb.0:92; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax93; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx94; X86-NEXT:    movzwl (%ecx), %ecx95; X86-NEXT:    cmpw (%eax), %cx96; X86-NEXT:    sete %al97; X86-NEXT:    retl98  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 2) nounwind99  %c = icmp eq i32 %m, 0100  ret i1 %c101}102 103define i1 @length2_lt(ptr %X, ptr %Y) nounwind {104; X86-LABEL: length2_lt:105; X86:       # %bb.0:106; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax107; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx108; X86-NEXT:    movzwl (%ecx), %ecx109; X86-NEXT:    movzwl (%eax), %edx110; X86-NEXT:    rolw $8, %cx111; X86-NEXT:    rolw $8, %dx112; X86-NEXT:    movzwl %cx, %eax113; X86-NEXT:    movzwl %dx, %ecx114; X86-NEXT:    subl %ecx, %eax115; X86-NEXT:    shrl $31, %eax116; X86-NEXT:    # kill: def $al killed $al killed $eax117; X86-NEXT:    retl118  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 2) nounwind119  %c = icmp slt i32 %m, 0120  ret i1 %c121}122 123define i1 @length2_gt(ptr %X, ptr %Y) nounwind {124; X86-LABEL: length2_gt:125; X86:       # %bb.0:126; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax127; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx128; X86-NEXT:    movzwl (%ecx), %ecx129; X86-NEXT:    movzwl (%eax), %eax130; X86-NEXT:    rolw $8, %cx131; X86-NEXT:    rolw $8, %ax132; X86-NEXT:    movzwl %cx, %ecx133; X86-NEXT:    movzwl %ax, %eax134; X86-NEXT:    subl %eax, %ecx135; X86-NEXT:    testl %ecx, %ecx136; X86-NEXT:    setg %al137; X86-NEXT:    retl138  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 2) nounwind139  %c = icmp sgt i32 %m, 0140  ret i1 %c141}142 143define i1 @length2_eq_const(ptr %X) nounwind {144; X86-LABEL: length2_eq_const:145; X86:       # %bb.0:146; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax147; X86-NEXT:    cmpw $12849, (%eax) # imm = 0x3231148; X86-NEXT:    setne %al149; X86-NEXT:    retl150  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 2) nounwind151  %c = icmp ne i32 %m, 0152  ret i1 %c153}154 155define i1 @length2_eq_nobuiltin_attr(ptr %X, ptr %Y) nounwind {156; X86-LABEL: length2_eq_nobuiltin_attr:157; X86:       # %bb.0:158; X86-NEXT:    pushl $2159; X86-NEXT:    pushl {{[0-9]+}}(%esp)160; X86-NEXT:    pushl {{[0-9]+}}(%esp)161; X86-NEXT:    calll memcmp162; X86-NEXT:    addl $12, %esp163; X86-NEXT:    testl %eax, %eax164; X86-NEXT:    sete %al165; X86-NEXT:    retl166  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 2) nounwind nobuiltin167  %c = icmp eq i32 %m, 0168  ret i1 %c169}170 171define i32 @length3(ptr %X, ptr %Y) nounwind {172; X86-LABEL: length3:173; X86:       # %bb.0:174; X86-NEXT:    pushl %esi175; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx176; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax177; X86-NEXT:    movzwl (%eax), %edx178; X86-NEXT:    movzwl (%ecx), %esi179; X86-NEXT:    rolw $8, %dx180; X86-NEXT:    rolw $8, %si181; X86-NEXT:    cmpw %si, %dx182; X86-NEXT:    jne .LBB11_3183; X86-NEXT:  # %bb.1: # %loadbb1184; X86-NEXT:    movzbl 2(%eax), %eax185; X86-NEXT:    movzbl 2(%ecx), %ecx186; X86-NEXT:    subl %ecx, %eax187; X86-NEXT:    popl %esi188; X86-NEXT:    retl189; X86-NEXT:  .LBB11_3: # %res_block190; X86-NEXT:    setae %al191; X86-NEXT:    movzbl %al, %eax192; X86-NEXT:    leal -1(%eax,%eax), %eax193; X86-NEXT:    popl %esi194; X86-NEXT:    retl195  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 3) nounwind196  ret i32 %m197}198 199define i1 @length3_eq(ptr %X, ptr %Y) nounwind {200; X86-LABEL: length3_eq:201; X86:       # %bb.0:202; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax203; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx204; X86-NEXT:    movzwl (%ecx), %edx205; X86-NEXT:    xorw (%eax), %dx206; X86-NEXT:    movzbl 2(%ecx), %ecx207; X86-NEXT:    xorb 2(%eax), %cl208; X86-NEXT:    movzbl %cl, %eax209; X86-NEXT:    orw %dx, %ax210; X86-NEXT:    setne %al211; X86-NEXT:    retl212  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 3) nounwind213  %c = icmp ne i32 %m, 0214  ret i1 %c215}216 217define i32 @length4(ptr %X, ptr %Y) nounwind {218; X86-LABEL: length4:219; X86:       # %bb.0:220; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax221; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx222; X86-NEXT:    movl (%ecx), %ecx223; X86-NEXT:    movl (%eax), %eax224; X86-NEXT:    bswapl %ecx225; X86-NEXT:    bswapl %eax226; X86-NEXT:    cmpl %eax, %ecx227; X86-NEXT:    seta %al228; X86-NEXT:    sbbb $0, %al229; X86-NEXT:    movsbl %al, %eax230; X86-NEXT:    retl231  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 4) nounwind232  ret i32 %m233}234 235define i1 @length4_eq(ptr %X, ptr %Y) nounwind {236; X86-LABEL: length4_eq:237; X86:       # %bb.0:238; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax239; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx240; X86-NEXT:    movl (%ecx), %ecx241; X86-NEXT:    cmpl (%eax), %ecx242; X86-NEXT:    setne %al243; X86-NEXT:    retl244  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 4) nounwind245  %c = icmp ne i32 %m, 0246  ret i1 %c247}248 249define i1 @length4_lt(ptr %X, ptr %Y) nounwind {250; X86-LABEL: length4_lt:251; X86:       # %bb.0:252; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax253; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx254; X86-NEXT:    movl (%ecx), %ecx255; X86-NEXT:    movl (%eax), %eax256; X86-NEXT:    bswapl %ecx257; X86-NEXT:    bswapl %eax258; X86-NEXT:    cmpl %eax, %ecx259; X86-NEXT:    setb %al260; X86-NEXT:    retl261  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 4) nounwind262  %c = icmp slt i32 %m, 0263  ret i1 %c264}265 266define i1 @length4_gt(ptr %X, ptr %Y) nounwind {267; X86-LABEL: length4_gt:268; X86:       # %bb.0:269; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax270; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx271; X86-NEXT:    movl (%ecx), %ecx272; X86-NEXT:    movl (%eax), %eax273; X86-NEXT:    bswapl %ecx274; X86-NEXT:    bswapl %eax275; X86-NEXT:    cmpl %eax, %ecx276; X86-NEXT:    seta %al277; X86-NEXT:    retl278  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 4) nounwind279  %c = icmp sgt i32 %m, 0280  ret i1 %c281}282 283define i1 @length4_eq_const(ptr %X) nounwind {284; X86-LABEL: length4_eq_const:285; X86:       # %bb.0:286; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax287; X86-NEXT:    cmpl $875770417, (%eax) # imm = 0x34333231288; X86-NEXT:    sete %al289; X86-NEXT:    retl290  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 4) nounwind291  %c = icmp eq i32 %m, 0292  ret i1 %c293}294 295define i32 @length5(ptr %X, ptr %Y) nounwind {296; X86-LABEL: length5:297; X86:       # %bb.0:298; X86-NEXT:    pushl %esi299; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx300; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax301; X86-NEXT:    movl (%eax), %edx302; X86-NEXT:    movl (%ecx), %esi303; X86-NEXT:    bswapl %edx304; X86-NEXT:    bswapl %esi305; X86-NEXT:    cmpl %esi, %edx306; X86-NEXT:    jne .LBB18_3307; X86-NEXT:  # %bb.1: # %loadbb1308; X86-NEXT:    movzbl 4(%eax), %eax309; X86-NEXT:    movzbl 4(%ecx), %ecx310; X86-NEXT:    subl %ecx, %eax311; X86-NEXT:    popl %esi312; X86-NEXT:    retl313; X86-NEXT:  .LBB18_3: # %res_block314; X86-NEXT:    setae %al315; X86-NEXT:    movzbl %al, %eax316; X86-NEXT:    leal -1(%eax,%eax), %eax317; X86-NEXT:    popl %esi318; X86-NEXT:    retl319  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 5) nounwind320  ret i32 %m321}322 323define i1 @length5_eq(ptr %X, ptr %Y) nounwind {324; X86-LABEL: length5_eq:325; X86:       # %bb.0:326; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax327; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx328; X86-NEXT:    movl (%ecx), %edx329; X86-NEXT:    xorl (%eax), %edx330; X86-NEXT:    movzbl 4(%ecx), %ecx331; X86-NEXT:    xorb 4(%eax), %cl332; X86-NEXT:    movzbl %cl, %eax333; X86-NEXT:    orl %edx, %eax334; X86-NEXT:    setne %al335; X86-NEXT:    retl336  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 5) nounwind337  %c = icmp ne i32 %m, 0338  ret i1 %c339}340 341define i1 @length5_lt(ptr %X, ptr %Y) nounwind {342; X86-LABEL: length5_lt:343; X86:       # %bb.0:344; X86-NEXT:    pushl %esi345; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx346; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax347; X86-NEXT:    movl (%eax), %edx348; X86-NEXT:    movl (%ecx), %esi349; X86-NEXT:    bswapl %edx350; X86-NEXT:    bswapl %esi351; X86-NEXT:    cmpl %esi, %edx352; X86-NEXT:    jne .LBB20_3353; X86-NEXT:  # %bb.1: # %loadbb1354; X86-NEXT:    movzbl 4(%eax), %eax355; X86-NEXT:    movzbl 4(%ecx), %ecx356; X86-NEXT:    subl %ecx, %eax357; X86-NEXT:    jmp .LBB20_2358; X86-NEXT:  .LBB20_3: # %res_block359; X86-NEXT:    setae %al360; X86-NEXT:    movzbl %al, %eax361; X86-NEXT:    leal -1(%eax,%eax), %eax362; X86-NEXT:  .LBB20_2: # %endblock363; X86-NEXT:    shrl $31, %eax364; X86-NEXT:    # kill: def $al killed $al killed $eax365; X86-NEXT:    popl %esi366; X86-NEXT:    retl367  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 5) nounwind368  %c = icmp slt i32 %m, 0369  ret i1 %c370}371 372define i32 @length7(ptr %X, ptr %Y) nounwind {373; X86-LABEL: length7:374; X86:       # %bb.0:375; X86-NEXT:    pushl %esi376; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax377; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi378; X86-NEXT:    movl (%esi), %ecx379; X86-NEXT:    movl (%eax), %edx380; X86-NEXT:    bswapl %ecx381; X86-NEXT:    bswapl %edx382; X86-NEXT:    cmpl %edx, %ecx383; X86-NEXT:    jne .LBB21_2384; X86-NEXT:  # %bb.1: # %loadbb1385; X86-NEXT:    movl 3(%esi), %ecx386; X86-NEXT:    movl 3(%eax), %edx387; X86-NEXT:    bswapl %ecx388; X86-NEXT:    bswapl %edx389; X86-NEXT:    xorl %eax, %eax390; X86-NEXT:    cmpl %edx, %ecx391; X86-NEXT:    je .LBB21_3392; X86-NEXT:  .LBB21_2: # %res_block393; X86-NEXT:    xorl %eax, %eax394; X86-NEXT:    cmpl %edx, %ecx395; X86-NEXT:    setae %al396; X86-NEXT:    leal -1(%eax,%eax), %eax397; X86-NEXT:  .LBB21_3: # %endblock398; X86-NEXT:    popl %esi399; X86-NEXT:    retl400  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 7) nounwind401  ret i32 %m402}403 404define i1 @length7_lt(ptr %X, ptr %Y) nounwind {405; X86-LABEL: length7_lt:406; X86:       # %bb.0:407; X86-NEXT:    pushl %esi408; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax409; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi410; X86-NEXT:    movl (%esi), %ecx411; X86-NEXT:    movl (%eax), %edx412; X86-NEXT:    bswapl %ecx413; X86-NEXT:    bswapl %edx414; X86-NEXT:    cmpl %edx, %ecx415; X86-NEXT:    jne .LBB22_2416; X86-NEXT:  # %bb.1: # %loadbb1417; X86-NEXT:    movl 3(%esi), %ecx418; X86-NEXT:    movl 3(%eax), %edx419; X86-NEXT:    bswapl %ecx420; X86-NEXT:    bswapl %edx421; X86-NEXT:    xorl %eax, %eax422; X86-NEXT:    cmpl %edx, %ecx423; X86-NEXT:    je .LBB22_3424; X86-NEXT:  .LBB22_2: # %res_block425; X86-NEXT:    xorl %eax, %eax426; X86-NEXT:    cmpl %edx, %ecx427; X86-NEXT:    setae %al428; X86-NEXT:    leal -1(%eax,%eax), %eax429; X86-NEXT:  .LBB22_3: # %endblock430; X86-NEXT:    shrl $31, %eax431; X86-NEXT:    # kill: def $al killed $al killed $eax432; X86-NEXT:    popl %esi433; X86-NEXT:    retl434  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 7) nounwind435  %c = icmp slt i32 %m, 0436  ret i1 %c437}438 439define i1 @length7_eq(ptr %X, ptr %Y) nounwind {440; X86-LABEL: length7_eq:441; X86:       # %bb.0:442; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax443; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx444; X86-NEXT:    movl (%ecx), %edx445; X86-NEXT:    movl 3(%ecx), %ecx446; X86-NEXT:    xorl (%eax), %edx447; X86-NEXT:    xorl 3(%eax), %ecx448; X86-NEXT:    orl %edx, %ecx449; X86-NEXT:    setne %al450; X86-NEXT:    retl451  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 7) nounwind452  %c = icmp ne i32 %m, 0453  ret i1 %c454}455 456define i32 @length8(ptr %X, ptr %Y) nounwind {457; X86-LABEL: length8:458; X86:       # %bb.0:459; X86-NEXT:    pushl %esi460; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax461; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi462; X86-NEXT:    movl (%esi), %ecx463; X86-NEXT:    movl (%eax), %edx464; X86-NEXT:    bswapl %ecx465; X86-NEXT:    bswapl %edx466; X86-NEXT:    cmpl %edx, %ecx467; X86-NEXT:    jne .LBB24_2468; X86-NEXT:  # %bb.1: # %loadbb1469; X86-NEXT:    movl 4(%esi), %ecx470; X86-NEXT:    movl 4(%eax), %edx471; X86-NEXT:    bswapl %ecx472; X86-NEXT:    bswapl %edx473; X86-NEXT:    xorl %eax, %eax474; X86-NEXT:    cmpl %edx, %ecx475; X86-NEXT:    je .LBB24_3476; X86-NEXT:  .LBB24_2: # %res_block477; X86-NEXT:    xorl %eax, %eax478; X86-NEXT:    cmpl %edx, %ecx479; X86-NEXT:    setae %al480; X86-NEXT:    leal -1(%eax,%eax), %eax481; X86-NEXT:  .LBB24_3: # %endblock482; X86-NEXT:    popl %esi483; X86-NEXT:    retl484  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 8) nounwind485  ret i32 %m486}487 488define i1 @length8_eq(ptr %X, ptr %Y) nounwind {489; X86-LABEL: length8_eq:490; X86:       # %bb.0:491; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax492; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx493; X86-NEXT:    movl (%ecx), %edx494; X86-NEXT:    movl 4(%ecx), %ecx495; X86-NEXT:    xorl (%eax), %edx496; X86-NEXT:    xorl 4(%eax), %ecx497; X86-NEXT:    orl %edx, %ecx498; X86-NEXT:    sete %al499; X86-NEXT:    retl500  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 8) nounwind501  %c = icmp eq i32 %m, 0502  ret i1 %c503}504 505define i1 @length8_eq_const(ptr %X) nounwind {506; X86-LABEL: length8_eq_const:507; X86:       # %bb.0:508; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax509; X86-NEXT:    movl $858927408, %ecx # imm = 0x33323130510; X86-NEXT:    xorl (%eax), %ecx511; X86-NEXT:    movl $926299444, %edx # imm = 0x37363534512; X86-NEXT:    xorl 4(%eax), %edx513; X86-NEXT:    orl %ecx, %edx514; X86-NEXT:    setne %al515; X86-NEXT:    retl516  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 8) nounwind517  %c = icmp ne i32 %m, 0518  ret i1 %c519}520 521define i1 @length9_eq(ptr %X, ptr %Y) nounwind {522; X86-LABEL: length9_eq:523; X86:       # %bb.0:524; X86-NEXT:    pushl $9525; X86-NEXT:    pushl {{[0-9]+}}(%esp)526; X86-NEXT:    pushl {{[0-9]+}}(%esp)527; X86-NEXT:    calll memcmp528; X86-NEXT:    addl $12, %esp529; X86-NEXT:    testl %eax, %eax530; X86-NEXT:    sete %al531; X86-NEXT:    retl532  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 9) nounwind533  %c = icmp eq i32 %m, 0534  ret i1 %c535}536 537define i1 @length10_eq(ptr %X, ptr %Y) nounwind {538; X86-LABEL: length10_eq:539; X86:       # %bb.0:540; X86-NEXT:    pushl $10541; X86-NEXT:    pushl {{[0-9]+}}(%esp)542; X86-NEXT:    pushl {{[0-9]+}}(%esp)543; X86-NEXT:    calll memcmp544; X86-NEXT:    addl $12, %esp545; X86-NEXT:    testl %eax, %eax546; X86-NEXT:    sete %al547; X86-NEXT:    retl548  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 10) nounwind549  %c = icmp eq i32 %m, 0550  ret i1 %c551}552 553define i1 @length11_eq(ptr %X, ptr %Y) nounwind {554; X86-LABEL: length11_eq:555; X86:       # %bb.0:556; X86-NEXT:    pushl $11557; X86-NEXT:    pushl {{[0-9]+}}(%esp)558; X86-NEXT:    pushl {{[0-9]+}}(%esp)559; X86-NEXT:    calll memcmp560; X86-NEXT:    addl $12, %esp561; X86-NEXT:    testl %eax, %eax562; X86-NEXT:    sete %al563; X86-NEXT:    retl564  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 11) nounwind565  %c = icmp eq i32 %m, 0566  ret i1 %c567}568 569define i1 @length12_eq(ptr %X, ptr %Y) nounwind {570; X86-LABEL: length12_eq:571; X86:       # %bb.0:572; X86-NEXT:    pushl $12573; X86-NEXT:    pushl {{[0-9]+}}(%esp)574; X86-NEXT:    pushl {{[0-9]+}}(%esp)575; X86-NEXT:    calll memcmp576; X86-NEXT:    addl $12, %esp577; X86-NEXT:    testl %eax, %eax578; X86-NEXT:    setne %al579; X86-NEXT:    retl580  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 12) nounwind581  %c = icmp ne i32 %m, 0582  ret i1 %c583}584 585define i32 @length12(ptr %X, ptr %Y) nounwind {586; X86-LABEL: length12:587; X86:       # %bb.0:588; X86-NEXT:    pushl $12589; X86-NEXT:    pushl {{[0-9]+}}(%esp)590; X86-NEXT:    pushl {{[0-9]+}}(%esp)591; X86-NEXT:    calll memcmp592; X86-NEXT:    addl $12, %esp593; X86-NEXT:    retl594  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 12) nounwind595  ret i32 %m596}597 598define i1 @length13_eq(ptr %X, ptr %Y) nounwind {599; X86-LABEL: length13_eq:600; X86:       # %bb.0:601; X86-NEXT:    pushl $13602; X86-NEXT:    pushl {{[0-9]+}}(%esp)603; X86-NEXT:    pushl {{[0-9]+}}(%esp)604; X86-NEXT:    calll memcmp605; X86-NEXT:    addl $12, %esp606; X86-NEXT:    testl %eax, %eax607; X86-NEXT:    sete %al608; X86-NEXT:    retl609  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 13) nounwind610  %c = icmp eq i32 %m, 0611  ret i1 %c612}613 614define i1 @length14_eq(ptr %X, ptr %Y) nounwind {615; X86-LABEL: length14_eq:616; X86:       # %bb.0:617; X86-NEXT:    pushl $14618; X86-NEXT:    pushl {{[0-9]+}}(%esp)619; X86-NEXT:    pushl {{[0-9]+}}(%esp)620; X86-NEXT:    calll memcmp621; X86-NEXT:    addl $12, %esp622; X86-NEXT:    testl %eax, %eax623; X86-NEXT:    sete %al624; X86-NEXT:    retl625  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 14) nounwind626  %c = icmp eq i32 %m, 0627  ret i1 %c628}629 630define i32 @length15(ptr %X, ptr %Y) nounwind {631; X86-LABEL: length15:632; X86:       # %bb.0:633; X86-NEXT:    pushl $15634; X86-NEXT:    pushl {{[0-9]+}}(%esp)635; X86-NEXT:    pushl {{[0-9]+}}(%esp)636; X86-NEXT:    calll memcmp637; X86-NEXT:    addl $12, %esp638; X86-NEXT:    retl639  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 15) nounwind640  ret i32 %m641}642 643define i1 @length15_lt(ptr %X, ptr %Y) nounwind {644; X86-LABEL: length15_lt:645; X86:       # %bb.0:646; X86-NEXT:    pushl $15647; X86-NEXT:    pushl {{[0-9]+}}(%esp)648; X86-NEXT:    pushl {{[0-9]+}}(%esp)649; X86-NEXT:    calll memcmp650; X86-NEXT:    addl $12, %esp651; X86-NEXT:    shrl $31, %eax652; X86-NEXT:    # kill: def $al killed $al killed $eax653; X86-NEXT:    retl654  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 15) nounwind655  %c = icmp slt i32 %m, 0656  ret i1 %c657}658 659define i32 @length15_const(ptr %X, ptr %Y) nounwind {660; X86-LABEL: length15_const:661; X86:       # %bb.0:662; X86-NEXT:    pushl $15663; X86-NEXT:    pushl $.L.str+1664; X86-NEXT:    pushl {{[0-9]+}}(%esp)665; X86-NEXT:    calll memcmp666; X86-NEXT:    addl $12, %esp667; X86-NEXT:    retl668  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 15) nounwind669  ret i32 %m670}671 672define i1 @length15_eq(ptr %X, ptr %Y) nounwind {673; X86-LABEL: length15_eq:674; X86:       # %bb.0:675; X86-NEXT:    pushl $15676; X86-NEXT:    pushl {{[0-9]+}}(%esp)677; X86-NEXT:    pushl {{[0-9]+}}(%esp)678; X86-NEXT:    calll memcmp679; X86-NEXT:    addl $12, %esp680; X86-NEXT:    testl %eax, %eax681; X86-NEXT:    sete %al682; X86-NEXT:    retl683  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 15) nounwind684  %c = icmp eq i32 %m, 0685  ret i1 %c686}687 688define i1 @length15_gt_const(ptr %X, ptr %Y) nounwind {689; X86-LABEL: length15_gt_const:690; X86:       # %bb.0:691; X86-NEXT:    pushl $15692; X86-NEXT:    pushl $.L.str+1693; X86-NEXT:    pushl {{[0-9]+}}(%esp)694; X86-NEXT:    calll memcmp695; X86-NEXT:    addl $12, %esp696; X86-NEXT:    testl %eax, %eax697; X86-NEXT:    setg %al698; X86-NEXT:    retl699  %m = tail call i32 @memcmp(ptr %X, ptr getelementptr inbounds ([513 x i8], ptr @.str, i32 0, i32 1), i32 15) nounwind700  %c = icmp sgt i32 %m, 0701  ret i1 %c702}703 704; PR33329 - https://bugs.llvm.org/show_bug.cgi?id=33329705 706define i32 @length16(ptr %X, ptr %Y) nounwind {707; X86-LABEL: length16:708; X86:       # %bb.0:709; X86-NEXT:    pushl $16710; X86-NEXT:    pushl {{[0-9]+}}(%esp)711; X86-NEXT:    pushl {{[0-9]+}}(%esp)712; X86-NEXT:    calll memcmp713; X86-NEXT:    addl $12, %esp714; X86-NEXT:    retl715  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 16) nounwind716  ret i32 %m717}718 719define i1 @length16_eq(ptr %x, ptr %y) nounwind {720; X86-NOSSE-LABEL: length16_eq:721; X86-NOSSE:       # %bb.0:722; X86-NOSSE-NEXT:    pushl $16723; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)724; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)725; X86-NOSSE-NEXT:    calll memcmp726; X86-NOSSE-NEXT:    addl $12, %esp727; X86-NOSSE-NEXT:    testl %eax, %eax728; X86-NOSSE-NEXT:    setne %al729; X86-NOSSE-NEXT:    retl730;731; X86-SSE1-LABEL: length16_eq:732; X86-SSE1:       # %bb.0:733; X86-SSE1-NEXT:    pushl $16734; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)735; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)736; X86-SSE1-NEXT:    calll memcmp737; X86-SSE1-NEXT:    addl $12, %esp738; X86-SSE1-NEXT:    testl %eax, %eax739; X86-SSE1-NEXT:    setne %al740; X86-SSE1-NEXT:    retl741;742; X86-SSE2-LABEL: length16_eq:743; X86-SSE2:       # %bb.0:744; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax745; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx746; X86-SSE2-NEXT:    movdqu (%ecx), %xmm0747; X86-SSE2-NEXT:    movdqu (%eax), %xmm1748; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm1749; X86-SSE2-NEXT:    pmovmskb %xmm1, %eax750; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF751; X86-SSE2-NEXT:    setne %al752; X86-SSE2-NEXT:    retl753;754; X86-SSE41-LABEL: length16_eq:755; X86-SSE41:       # %bb.0:756; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax757; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx758; X86-SSE41-NEXT:    movdqu (%ecx), %xmm0759; X86-SSE41-NEXT:    movdqu (%eax), %xmm1760; X86-SSE41-NEXT:    pxor %xmm0, %xmm1761; X86-SSE41-NEXT:    ptest %xmm1, %xmm1762; X86-SSE41-NEXT:    setne %al763; X86-SSE41-NEXT:    retl764  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 16) nounwind765  %cmp = icmp ne i32 %call, 0766  ret i1 %cmp767}768 769define i1 @length16_lt(ptr %x, ptr %y) nounwind {770; X86-LABEL: length16_lt:771; X86:       # %bb.0:772; X86-NEXT:    pushl $16773; X86-NEXT:    pushl {{[0-9]+}}(%esp)774; X86-NEXT:    pushl {{[0-9]+}}(%esp)775; X86-NEXT:    calll memcmp776; X86-NEXT:    addl $12, %esp777; X86-NEXT:    shrl $31, %eax778; X86-NEXT:    # kill: def $al killed $al killed $eax779; X86-NEXT:    retl780  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 16) nounwind781  %cmp = icmp slt i32 %call, 0782  ret i1 %cmp783}784 785define i1 @length16_gt(ptr %x, ptr %y) nounwind {786; X86-LABEL: length16_gt:787; X86:       # %bb.0:788; X86-NEXT:    pushl $16789; X86-NEXT:    pushl {{[0-9]+}}(%esp)790; X86-NEXT:    pushl {{[0-9]+}}(%esp)791; X86-NEXT:    calll memcmp792; X86-NEXT:    addl $12, %esp793; X86-NEXT:    testl %eax, %eax794; X86-NEXT:    setg %al795; X86-NEXT:    retl796  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 16) nounwind797  %cmp = icmp sgt i32 %call, 0798  ret i1 %cmp799}800 801define i1 @length16_eq_const(ptr %X) nounwind {802; X86-NOSSE-LABEL: length16_eq_const:803; X86-NOSSE:       # %bb.0:804; X86-NOSSE-NEXT:    pushl $16805; X86-NOSSE-NEXT:    pushl $.L.str806; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)807; X86-NOSSE-NEXT:    calll memcmp808; X86-NOSSE-NEXT:    addl $12, %esp809; X86-NOSSE-NEXT:    testl %eax, %eax810; X86-NOSSE-NEXT:    sete %al811; X86-NOSSE-NEXT:    retl812;813; X86-SSE1-LABEL: length16_eq_const:814; X86-SSE1:       # %bb.0:815; X86-SSE1-NEXT:    pushl $16816; X86-SSE1-NEXT:    pushl $.L.str817; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)818; X86-SSE1-NEXT:    calll memcmp819; X86-SSE1-NEXT:    addl $12, %esp820; X86-SSE1-NEXT:    testl %eax, %eax821; X86-SSE1-NEXT:    sete %al822; X86-SSE1-NEXT:    retl823;824; X86-SSE2-LABEL: length16_eq_const:825; X86-SSE2:       # %bb.0:826; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax827; X86-SSE2-NEXT:    movdqu (%eax), %xmm0828; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0829; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax830; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF831; X86-SSE2-NEXT:    sete %al832; X86-SSE2-NEXT:    retl833;834; X86-SSE41-LABEL: length16_eq_const:835; X86-SSE41:       # %bb.0:836; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax837; X86-SSE41-NEXT:    movdqu (%eax), %xmm0838; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0839; X86-SSE41-NEXT:    ptest %xmm0, %xmm0840; X86-SSE41-NEXT:    sete %al841; X86-SSE41-NEXT:    retl842  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 16) nounwind843  %c = icmp eq i32 %m, 0844  ret i1 %c845}846 847; PR33914 - https://bugs.llvm.org/show_bug.cgi?id=33914848 849define i32 @length24(ptr %X, ptr %Y) nounwind {850; X86-LABEL: length24:851; X86:       # %bb.0:852; X86-NEXT:    pushl $24853; X86-NEXT:    pushl {{[0-9]+}}(%esp)854; X86-NEXT:    pushl {{[0-9]+}}(%esp)855; X86-NEXT:    calll memcmp856; X86-NEXT:    addl $12, %esp857; X86-NEXT:    retl858  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 24) nounwind859  ret i32 %m860}861 862define i1 @length24_eq(ptr %x, ptr %y) nounwind {863; X86-NOSSE-LABEL: length24_eq:864; X86-NOSSE:       # %bb.0:865; X86-NOSSE-NEXT:    pushl $24866; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)867; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)868; X86-NOSSE-NEXT:    calll memcmp869; X86-NOSSE-NEXT:    addl $12, %esp870; X86-NOSSE-NEXT:    testl %eax, %eax871; X86-NOSSE-NEXT:    sete %al872; X86-NOSSE-NEXT:    retl873;874; X86-SSE1-LABEL: length24_eq:875; X86-SSE1:       # %bb.0:876; X86-SSE1-NEXT:    pushl $24877; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)878; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)879; X86-SSE1-NEXT:    calll memcmp880; X86-SSE1-NEXT:    addl $12, %esp881; X86-SSE1-NEXT:    testl %eax, %eax882; X86-SSE1-NEXT:    sete %al883; X86-SSE1-NEXT:    retl884;885; X86-SSE2-LABEL: length24_eq:886; X86-SSE2:       # %bb.0:887; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax888; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx889; X86-SSE2-NEXT:    movdqu (%ecx), %xmm0890; X86-SSE2-NEXT:    movdqu 8(%ecx), %xmm1891; X86-SSE2-NEXT:    movdqu (%eax), %xmm2892; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm2893; X86-SSE2-NEXT:    movdqu 8(%eax), %xmm0894; X86-SSE2-NEXT:    pcmpeqb %xmm1, %xmm0895; X86-SSE2-NEXT:    pand %xmm2, %xmm0896; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax897; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF898; X86-SSE2-NEXT:    sete %al899; X86-SSE2-NEXT:    retl900;901; X86-SSE41-LABEL: length24_eq:902; X86-SSE41:       # %bb.0:903; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax904; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx905; X86-SSE41-NEXT:    movdqu (%ecx), %xmm0906; X86-SSE41-NEXT:    movdqu 8(%ecx), %xmm1907; X86-SSE41-NEXT:    movdqu (%eax), %xmm2908; X86-SSE41-NEXT:    pxor %xmm0, %xmm2909; X86-SSE41-NEXT:    movdqu 8(%eax), %xmm0910; X86-SSE41-NEXT:    pxor %xmm1, %xmm0911; X86-SSE41-NEXT:    por %xmm2, %xmm0912; X86-SSE41-NEXT:    ptest %xmm0, %xmm0913; X86-SSE41-NEXT:    sete %al914; X86-SSE41-NEXT:    retl915  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 24) nounwind916  %cmp = icmp eq i32 %call, 0917  ret i1 %cmp918}919 920define i1 @length24_lt(ptr %x, ptr %y) nounwind {921; X86-LABEL: length24_lt:922; X86:       # %bb.0:923; X86-NEXT:    pushl $24924; X86-NEXT:    pushl {{[0-9]+}}(%esp)925; X86-NEXT:    pushl {{[0-9]+}}(%esp)926; X86-NEXT:    calll memcmp927; X86-NEXT:    addl $12, %esp928; X86-NEXT:    shrl $31, %eax929; X86-NEXT:    # kill: def $al killed $al killed $eax930; X86-NEXT:    retl931  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 24) nounwind932  %cmp = icmp slt i32 %call, 0933  ret i1 %cmp934}935 936define i1 @length24_gt(ptr %x, ptr %y) nounwind {937; X86-LABEL: length24_gt:938; X86:       # %bb.0:939; X86-NEXT:    pushl $24940; X86-NEXT:    pushl {{[0-9]+}}(%esp)941; X86-NEXT:    pushl {{[0-9]+}}(%esp)942; X86-NEXT:    calll memcmp943; X86-NEXT:    addl $12, %esp944; X86-NEXT:    testl %eax, %eax945; X86-NEXT:    setg %al946; X86-NEXT:    retl947  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 24) nounwind948  %cmp = icmp sgt i32 %call, 0949  ret i1 %cmp950}951 952define i1 @length24_eq_const(ptr %X) nounwind {953; X86-NOSSE-LABEL: length24_eq_const:954; X86-NOSSE:       # %bb.0:955; X86-NOSSE-NEXT:    pushl $24956; X86-NOSSE-NEXT:    pushl $.L.str957; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)958; X86-NOSSE-NEXT:    calll memcmp959; X86-NOSSE-NEXT:    addl $12, %esp960; X86-NOSSE-NEXT:    testl %eax, %eax961; X86-NOSSE-NEXT:    setne %al962; X86-NOSSE-NEXT:    retl963;964; X86-SSE1-LABEL: length24_eq_const:965; X86-SSE1:       # %bb.0:966; X86-SSE1-NEXT:    pushl $24967; X86-SSE1-NEXT:    pushl $.L.str968; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)969; X86-SSE1-NEXT:    calll memcmp970; X86-SSE1-NEXT:    addl $12, %esp971; X86-SSE1-NEXT:    testl %eax, %eax972; X86-SSE1-NEXT:    setne %al973; X86-SSE1-NEXT:    retl974;975; X86-SSE2-LABEL: length24_eq_const:976; X86-SSE2:       # %bb.0:977; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax978; X86-SSE2-NEXT:    movdqu (%eax), %xmm0979; X86-SSE2-NEXT:    movdqu 8(%eax), %xmm1980; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1981; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0982; X86-SSE2-NEXT:    pand %xmm1, %xmm0983; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax984; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF985; X86-SSE2-NEXT:    setne %al986; X86-SSE2-NEXT:    retl987;988; X86-SSE41-LABEL: length24_eq_const:989; X86-SSE41:       # %bb.0:990; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax991; X86-SSE41-NEXT:    movdqu (%eax), %xmm0992; X86-SSE41-NEXT:    movdqu 8(%eax), %xmm1993; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1994; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0995; X86-SSE41-NEXT:    por %xmm1, %xmm0996; X86-SSE41-NEXT:    ptest %xmm0, %xmm0997; X86-SSE41-NEXT:    setne %al998; X86-SSE41-NEXT:    retl999  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 24) nounwind1000  %c = icmp ne i32 %m, 01001  ret i1 %c1002}1003 1004define i32 @length31(ptr %X, ptr %Y) nounwind {1005; X86-LABEL: length31:1006; X86:       # %bb.0:1007; X86-NEXT:    pushl $311008; X86-NEXT:    pushl {{[0-9]+}}(%esp)1009; X86-NEXT:    pushl {{[0-9]+}}(%esp)1010; X86-NEXT:    calll memcmp1011; X86-NEXT:    addl $12, %esp1012; X86-NEXT:    retl1013  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 31) nounwind1014  ret i32 %m1015}1016 1017define i1 @length31_eq(ptr %x, ptr %y) nounwind {1018; X86-NOSSE-LABEL: length31_eq:1019; X86-NOSSE:       # %bb.0:1020; X86-NOSSE-NEXT:    pushl $311021; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1022; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1023; X86-NOSSE-NEXT:    calll memcmp1024; X86-NOSSE-NEXT:    addl $12, %esp1025; X86-NOSSE-NEXT:    testl %eax, %eax1026; X86-NOSSE-NEXT:    sete %al1027; X86-NOSSE-NEXT:    retl1028;1029; X86-SSE1-LABEL: length31_eq:1030; X86-SSE1:       # %bb.0:1031; X86-SSE1-NEXT:    pushl $311032; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1033; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1034; X86-SSE1-NEXT:    calll memcmp1035; X86-SSE1-NEXT:    addl $12, %esp1036; X86-SSE1-NEXT:    testl %eax, %eax1037; X86-SSE1-NEXT:    sete %al1038; X86-SSE1-NEXT:    retl1039;1040; X86-SSE2-LABEL: length31_eq:1041; X86-SSE2:       # %bb.0:1042; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1043; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx1044; X86-SSE2-NEXT:    movdqu (%ecx), %xmm01045; X86-SSE2-NEXT:    movdqu 15(%ecx), %xmm11046; X86-SSE2-NEXT:    movdqu (%eax), %xmm21047; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm21048; X86-SSE2-NEXT:    movdqu 15(%eax), %xmm01049; X86-SSE2-NEXT:    pcmpeqb %xmm1, %xmm01050; X86-SSE2-NEXT:    pand %xmm2, %xmm01051; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1052; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1053; X86-SSE2-NEXT:    sete %al1054; X86-SSE2-NEXT:    retl1055;1056; X86-SSE41-LABEL: length31_eq:1057; X86-SSE41:       # %bb.0:1058; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1059; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx1060; X86-SSE41-NEXT:    movdqu (%ecx), %xmm01061; X86-SSE41-NEXT:    movdqu 15(%ecx), %xmm11062; X86-SSE41-NEXT:    movdqu (%eax), %xmm21063; X86-SSE41-NEXT:    pxor %xmm0, %xmm21064; X86-SSE41-NEXT:    movdqu 15(%eax), %xmm01065; X86-SSE41-NEXT:    pxor %xmm1, %xmm01066; X86-SSE41-NEXT:    por %xmm2, %xmm01067; X86-SSE41-NEXT:    ptest %xmm0, %xmm01068; X86-SSE41-NEXT:    sete %al1069; X86-SSE41-NEXT:    retl1070  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 31) nounwind1071  %cmp = icmp eq i32 %call, 01072  ret i1 %cmp1073}1074 1075define i1 @length31_lt(ptr %x, ptr %y) nounwind {1076; X86-LABEL: length31_lt:1077; X86:       # %bb.0:1078; X86-NEXT:    pushl $311079; X86-NEXT:    pushl {{[0-9]+}}(%esp)1080; X86-NEXT:    pushl {{[0-9]+}}(%esp)1081; X86-NEXT:    calll memcmp1082; X86-NEXT:    addl $12, %esp1083; X86-NEXT:    shrl $31, %eax1084; X86-NEXT:    # kill: def $al killed $al killed $eax1085; X86-NEXT:    retl1086  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 31) nounwind1087  %cmp = icmp slt i32 %call, 01088  ret i1 %cmp1089}1090 1091define i1 @length31_gt(ptr %x, ptr %y) nounwind {1092; X86-LABEL: length31_gt:1093; X86:       # %bb.0:1094; X86-NEXT:    pushl $311095; X86-NEXT:    pushl {{[0-9]+}}(%esp)1096; X86-NEXT:    pushl {{[0-9]+}}(%esp)1097; X86-NEXT:    calll memcmp1098; X86-NEXT:    addl $12, %esp1099; X86-NEXT:    testl %eax, %eax1100; X86-NEXT:    setg %al1101; X86-NEXT:    retl1102  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 31) nounwind1103  %cmp = icmp sgt i32 %call, 01104  ret i1 %cmp1105}1106 1107define i1 @length31_eq_prefer128(ptr %x, ptr %y) nounwind "prefer-vector-width"="128" {1108; X86-NOSSE-LABEL: length31_eq_prefer128:1109; X86-NOSSE:       # %bb.0:1110; X86-NOSSE-NEXT:    pushl $311111; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1112; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1113; X86-NOSSE-NEXT:    calll memcmp1114; X86-NOSSE-NEXT:    addl $12, %esp1115; X86-NOSSE-NEXT:    testl %eax, %eax1116; X86-NOSSE-NEXT:    sete %al1117; X86-NOSSE-NEXT:    retl1118;1119; X86-SSE1-LABEL: length31_eq_prefer128:1120; X86-SSE1:       # %bb.0:1121; X86-SSE1-NEXT:    pushl $311122; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1123; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1124; X86-SSE1-NEXT:    calll memcmp1125; X86-SSE1-NEXT:    addl $12, %esp1126; X86-SSE1-NEXT:    testl %eax, %eax1127; X86-SSE1-NEXT:    sete %al1128; X86-SSE1-NEXT:    retl1129;1130; X86-SSE2-LABEL: length31_eq_prefer128:1131; X86-SSE2:       # %bb.0:1132; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1133; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx1134; X86-SSE2-NEXT:    movdqu (%ecx), %xmm01135; X86-SSE2-NEXT:    movdqu 15(%ecx), %xmm11136; X86-SSE2-NEXT:    movdqu (%eax), %xmm21137; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm21138; X86-SSE2-NEXT:    movdqu 15(%eax), %xmm01139; X86-SSE2-NEXT:    pcmpeqb %xmm1, %xmm01140; X86-SSE2-NEXT:    pand %xmm2, %xmm01141; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1142; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1143; X86-SSE2-NEXT:    sete %al1144; X86-SSE2-NEXT:    retl1145;1146; X86-SSE41-LABEL: length31_eq_prefer128:1147; X86-SSE41:       # %bb.0:1148; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1149; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx1150; X86-SSE41-NEXT:    movdqu (%ecx), %xmm01151; X86-SSE41-NEXT:    movdqu 15(%ecx), %xmm11152; X86-SSE41-NEXT:    movdqu (%eax), %xmm21153; X86-SSE41-NEXT:    pxor %xmm0, %xmm21154; X86-SSE41-NEXT:    movdqu 15(%eax), %xmm01155; X86-SSE41-NEXT:    pxor %xmm1, %xmm01156; X86-SSE41-NEXT:    por %xmm2, %xmm01157; X86-SSE41-NEXT:    ptest %xmm0, %xmm01158; X86-SSE41-NEXT:    sete %al1159; X86-SSE41-NEXT:    retl1160  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 31) nounwind1161  %cmp = icmp eq i32 %call, 01162  ret i1 %cmp1163}1164 1165define i1 @length31_eq_const(ptr %X) nounwind {1166; X86-NOSSE-LABEL: length31_eq_const:1167; X86-NOSSE:       # %bb.0:1168; X86-NOSSE-NEXT:    pushl $311169; X86-NOSSE-NEXT:    pushl $.L.str1170; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1171; X86-NOSSE-NEXT:    calll memcmp1172; X86-NOSSE-NEXT:    addl $12, %esp1173; X86-NOSSE-NEXT:    testl %eax, %eax1174; X86-NOSSE-NEXT:    setne %al1175; X86-NOSSE-NEXT:    retl1176;1177; X86-SSE1-LABEL: length31_eq_const:1178; X86-SSE1:       # %bb.0:1179; X86-SSE1-NEXT:    pushl $311180; X86-SSE1-NEXT:    pushl $.L.str1181; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1182; X86-SSE1-NEXT:    calll memcmp1183; X86-SSE1-NEXT:    addl $12, %esp1184; X86-SSE1-NEXT:    testl %eax, %eax1185; X86-SSE1-NEXT:    setne %al1186; X86-SSE1-NEXT:    retl1187;1188; X86-SSE2-LABEL: length31_eq_const:1189; X86-SSE2:       # %bb.0:1190; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1191; X86-SSE2-NEXT:    movdqu (%eax), %xmm01192; X86-SSE2-NEXT:    movdqu 15(%eax), %xmm11193; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm11194; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm01195; X86-SSE2-NEXT:    pand %xmm1, %xmm01196; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1197; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1198; X86-SSE2-NEXT:    setne %al1199; X86-SSE2-NEXT:    retl1200;1201; X86-SSE41-LABEL: length31_eq_const:1202; X86-SSE41:       # %bb.0:1203; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1204; X86-SSE41-NEXT:    movdqu (%eax), %xmm01205; X86-SSE41-NEXT:    movdqu 15(%eax), %xmm11206; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm11207; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm01208; X86-SSE41-NEXT:    por %xmm1, %xmm01209; X86-SSE41-NEXT:    ptest %xmm0, %xmm01210; X86-SSE41-NEXT:    setne %al1211; X86-SSE41-NEXT:    retl1212  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 31) nounwind1213  %c = icmp ne i32 %m, 01214  ret i1 %c1215}1216 1217define i32 @length32(ptr %X, ptr %Y) nounwind {1218; X86-LABEL: length32:1219; X86:       # %bb.0:1220; X86-NEXT:    pushl $321221; X86-NEXT:    pushl {{[0-9]+}}(%esp)1222; X86-NEXT:    pushl {{[0-9]+}}(%esp)1223; X86-NEXT:    calll memcmp1224; X86-NEXT:    addl $12, %esp1225; X86-NEXT:    retl1226  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 32) nounwind1227  ret i32 %m1228}1229 1230; PR33325 - https://bugs.llvm.org/show_bug.cgi?id=333251231 1232define i1 @length32_eq(ptr %x, ptr %y) nounwind {1233; X86-NOSSE-LABEL: length32_eq:1234; X86-NOSSE:       # %bb.0:1235; X86-NOSSE-NEXT:    pushl $321236; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1237; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1238; X86-NOSSE-NEXT:    calll memcmp1239; X86-NOSSE-NEXT:    addl $12, %esp1240; X86-NOSSE-NEXT:    testl %eax, %eax1241; X86-NOSSE-NEXT:    sete %al1242; X86-NOSSE-NEXT:    retl1243;1244; X86-SSE1-LABEL: length32_eq:1245; X86-SSE1:       # %bb.0:1246; X86-SSE1-NEXT:    pushl $321247; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1248; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1249; X86-SSE1-NEXT:    calll memcmp1250; X86-SSE1-NEXT:    addl $12, %esp1251; X86-SSE1-NEXT:    testl %eax, %eax1252; X86-SSE1-NEXT:    sete %al1253; X86-SSE1-NEXT:    retl1254;1255; X86-SSE2-LABEL: length32_eq:1256; X86-SSE2:       # %bb.0:1257; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1258; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx1259; X86-SSE2-NEXT:    movdqu (%ecx), %xmm01260; X86-SSE2-NEXT:    movdqu 16(%ecx), %xmm11261; X86-SSE2-NEXT:    movdqu (%eax), %xmm21262; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm21263; X86-SSE2-NEXT:    movdqu 16(%eax), %xmm01264; X86-SSE2-NEXT:    pcmpeqb %xmm1, %xmm01265; X86-SSE2-NEXT:    pand %xmm2, %xmm01266; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1267; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1268; X86-SSE2-NEXT:    sete %al1269; X86-SSE2-NEXT:    retl1270;1271; X86-SSE41-LABEL: length32_eq:1272; X86-SSE41:       # %bb.0:1273; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1274; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx1275; X86-SSE41-NEXT:    movdqu (%ecx), %xmm01276; X86-SSE41-NEXT:    movdqu 16(%ecx), %xmm11277; X86-SSE41-NEXT:    movdqu (%eax), %xmm21278; X86-SSE41-NEXT:    pxor %xmm0, %xmm21279; X86-SSE41-NEXT:    movdqu 16(%eax), %xmm01280; X86-SSE41-NEXT:    pxor %xmm1, %xmm01281; X86-SSE41-NEXT:    por %xmm2, %xmm01282; X86-SSE41-NEXT:    ptest %xmm0, %xmm01283; X86-SSE41-NEXT:    sete %al1284; X86-SSE41-NEXT:    retl1285  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 32) nounwind1286  %cmp = icmp eq i32 %call, 01287  ret i1 %cmp1288}1289 1290define i1 @length32_lt(ptr %x, ptr %y) nounwind {1291; X86-LABEL: length32_lt:1292; X86:       # %bb.0:1293; X86-NEXT:    pushl $321294; X86-NEXT:    pushl {{[0-9]+}}(%esp)1295; X86-NEXT:    pushl {{[0-9]+}}(%esp)1296; X86-NEXT:    calll memcmp1297; X86-NEXT:    addl $12, %esp1298; X86-NEXT:    shrl $31, %eax1299; X86-NEXT:    # kill: def $al killed $al killed $eax1300; X86-NEXT:    retl1301  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 32) nounwind1302  %cmp = icmp slt i32 %call, 01303  ret i1 %cmp1304}1305 1306define i1 @length32_gt(ptr %x, ptr %y) nounwind {1307; X86-LABEL: length32_gt:1308; X86:       # %bb.0:1309; X86-NEXT:    pushl $321310; X86-NEXT:    pushl {{[0-9]+}}(%esp)1311; X86-NEXT:    pushl {{[0-9]+}}(%esp)1312; X86-NEXT:    calll memcmp1313; X86-NEXT:    addl $12, %esp1314; X86-NEXT:    testl %eax, %eax1315; X86-NEXT:    setg %al1316; X86-NEXT:    retl1317  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 32) nounwind1318  %cmp = icmp sgt i32 %call, 01319  ret i1 %cmp1320}1321 1322define i1 @length32_eq_prefer128(ptr %x, ptr %y) nounwind "prefer-vector-width"="128" {1323; X86-NOSSE-LABEL: length32_eq_prefer128:1324; X86-NOSSE:       # %bb.0:1325; X86-NOSSE-NEXT:    pushl $321326; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1327; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1328; X86-NOSSE-NEXT:    calll memcmp1329; X86-NOSSE-NEXT:    addl $12, %esp1330; X86-NOSSE-NEXT:    testl %eax, %eax1331; X86-NOSSE-NEXT:    sete %al1332; X86-NOSSE-NEXT:    retl1333;1334; X86-SSE1-LABEL: length32_eq_prefer128:1335; X86-SSE1:       # %bb.0:1336; X86-SSE1-NEXT:    pushl $321337; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1338; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1339; X86-SSE1-NEXT:    calll memcmp1340; X86-SSE1-NEXT:    addl $12, %esp1341; X86-SSE1-NEXT:    testl %eax, %eax1342; X86-SSE1-NEXT:    sete %al1343; X86-SSE1-NEXT:    retl1344;1345; X86-SSE2-LABEL: length32_eq_prefer128:1346; X86-SSE2:       # %bb.0:1347; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1348; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %ecx1349; X86-SSE2-NEXT:    movdqu (%ecx), %xmm01350; X86-SSE2-NEXT:    movdqu 16(%ecx), %xmm11351; X86-SSE2-NEXT:    movdqu (%eax), %xmm21352; X86-SSE2-NEXT:    pcmpeqb %xmm0, %xmm21353; X86-SSE2-NEXT:    movdqu 16(%eax), %xmm01354; X86-SSE2-NEXT:    pcmpeqb %xmm1, %xmm01355; X86-SSE2-NEXT:    pand %xmm2, %xmm01356; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1357; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1358; X86-SSE2-NEXT:    sete %al1359; X86-SSE2-NEXT:    retl1360;1361; X86-SSE41-LABEL: length32_eq_prefer128:1362; X86-SSE41:       # %bb.0:1363; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1364; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %ecx1365; X86-SSE41-NEXT:    movdqu (%ecx), %xmm01366; X86-SSE41-NEXT:    movdqu 16(%ecx), %xmm11367; X86-SSE41-NEXT:    movdqu (%eax), %xmm21368; X86-SSE41-NEXT:    pxor %xmm0, %xmm21369; X86-SSE41-NEXT:    movdqu 16(%eax), %xmm01370; X86-SSE41-NEXT:    pxor %xmm1, %xmm01371; X86-SSE41-NEXT:    por %xmm2, %xmm01372; X86-SSE41-NEXT:    ptest %xmm0, %xmm01373; X86-SSE41-NEXT:    sete %al1374; X86-SSE41-NEXT:    retl1375  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 32) nounwind1376  %cmp = icmp eq i32 %call, 01377  ret i1 %cmp1378}1379 1380define i1 @length32_eq_const(ptr %X) nounwind {1381; X86-NOSSE-LABEL: length32_eq_const:1382; X86-NOSSE:       # %bb.0:1383; X86-NOSSE-NEXT:    pushl $321384; X86-NOSSE-NEXT:    pushl $.L.str1385; X86-NOSSE-NEXT:    pushl {{[0-9]+}}(%esp)1386; X86-NOSSE-NEXT:    calll memcmp1387; X86-NOSSE-NEXT:    addl $12, %esp1388; X86-NOSSE-NEXT:    testl %eax, %eax1389; X86-NOSSE-NEXT:    setne %al1390; X86-NOSSE-NEXT:    retl1391;1392; X86-SSE1-LABEL: length32_eq_const:1393; X86-SSE1:       # %bb.0:1394; X86-SSE1-NEXT:    pushl $321395; X86-SSE1-NEXT:    pushl $.L.str1396; X86-SSE1-NEXT:    pushl {{[0-9]+}}(%esp)1397; X86-SSE1-NEXT:    calll memcmp1398; X86-SSE1-NEXT:    addl $12, %esp1399; X86-SSE1-NEXT:    testl %eax, %eax1400; X86-SSE1-NEXT:    setne %al1401; X86-SSE1-NEXT:    retl1402;1403; X86-SSE2-LABEL: length32_eq_const:1404; X86-SSE2:       # %bb.0:1405; X86-SSE2-NEXT:    movl {{[0-9]+}}(%esp), %eax1406; X86-SSE2-NEXT:    movdqu (%eax), %xmm01407; X86-SSE2-NEXT:    movdqu 16(%eax), %xmm11408; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm11409; X86-SSE2-NEXT:    pcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}, %xmm01410; X86-SSE2-NEXT:    pand %xmm1, %xmm01411; X86-SSE2-NEXT:    pmovmskb %xmm0, %eax1412; X86-SSE2-NEXT:    cmpl $65535, %eax # imm = 0xFFFF1413; X86-SSE2-NEXT:    setne %al1414; X86-SSE2-NEXT:    retl1415;1416; X86-SSE41-LABEL: length32_eq_const:1417; X86-SSE41:       # %bb.0:1418; X86-SSE41-NEXT:    movl {{[0-9]+}}(%esp), %eax1419; X86-SSE41-NEXT:    movdqu (%eax), %xmm01420; X86-SSE41-NEXT:    movdqu 16(%eax), %xmm11421; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm11422; X86-SSE41-NEXT:    pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm01423; X86-SSE41-NEXT:    por %xmm1, %xmm01424; X86-SSE41-NEXT:    ptest %xmm0, %xmm01425; X86-SSE41-NEXT:    setne %al1426; X86-SSE41-NEXT:    retl1427  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 32) nounwind1428  %c = icmp ne i32 %m, 01429  ret i1 %c1430}1431 1432define i32 @length48(ptr %X, ptr %Y) nounwind {1433; X86-LABEL: length48:1434; X86:       # %bb.0:1435; X86-NEXT:    pushl $481436; X86-NEXT:    pushl {{[0-9]+}}(%esp)1437; X86-NEXT:    pushl {{[0-9]+}}(%esp)1438; X86-NEXT:    calll memcmp1439; X86-NEXT:    addl $12, %esp1440; X86-NEXT:    retl1441  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 48) nounwind1442  ret i32 %m1443}1444 1445define i1 @length48_eq(ptr %x, ptr %y) nounwind {1446; X86-LABEL: length48_eq:1447; X86:       # %bb.0:1448; X86-NEXT:    pushl $481449; X86-NEXT:    pushl {{[0-9]+}}(%esp)1450; X86-NEXT:    pushl {{[0-9]+}}(%esp)1451; X86-NEXT:    calll memcmp1452; X86-NEXT:    addl $12, %esp1453; X86-NEXT:    testl %eax, %eax1454; X86-NEXT:    sete %al1455; X86-NEXT:    retl1456  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 48) nounwind1457  %cmp = icmp eq i32 %call, 01458  ret i1 %cmp1459}1460 1461define i1 @length48_lt(ptr %x, ptr %y) nounwind {1462; X86-LABEL: length48_lt:1463; X86:       # %bb.0:1464; X86-NEXT:    pushl $481465; X86-NEXT:    pushl {{[0-9]+}}(%esp)1466; X86-NEXT:    pushl {{[0-9]+}}(%esp)1467; X86-NEXT:    calll memcmp1468; X86-NEXT:    addl $12, %esp1469; X86-NEXT:    shrl $31, %eax1470; X86-NEXT:    # kill: def $al killed $al killed $eax1471; X86-NEXT:    retl1472  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 48) nounwind1473  %cmp = icmp slt i32 %call, 01474  ret i1 %cmp1475}1476 1477define i1 @length48_gt(ptr %x, ptr %y) nounwind {1478; X86-LABEL: length48_gt:1479; X86:       # %bb.0:1480; X86-NEXT:    pushl $481481; X86-NEXT:    pushl {{[0-9]+}}(%esp)1482; X86-NEXT:    pushl {{[0-9]+}}(%esp)1483; X86-NEXT:    calll memcmp1484; X86-NEXT:    addl $12, %esp1485; X86-NEXT:    testl %eax, %eax1486; X86-NEXT:    setg %al1487; X86-NEXT:    retl1488  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 48) nounwind1489  %cmp = icmp sgt i32 %call, 01490  ret i1 %cmp1491}1492 1493define i1 @length48_eq_prefer128(ptr %x, ptr %y) nounwind "prefer-vector-width"="128" {1494; X86-LABEL: length48_eq_prefer128:1495; X86:       # %bb.0:1496; X86-NEXT:    pushl $481497; X86-NEXT:    pushl {{[0-9]+}}(%esp)1498; X86-NEXT:    pushl {{[0-9]+}}(%esp)1499; X86-NEXT:    calll memcmp1500; X86-NEXT:    addl $12, %esp1501; X86-NEXT:    testl %eax, %eax1502; X86-NEXT:    sete %al1503; X86-NEXT:    retl1504  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 48) nounwind1505  %cmp = icmp eq i32 %call, 01506  ret i1 %cmp1507}1508 1509define i1 @length48_eq_const(ptr %X) nounwind {1510; X86-LABEL: length48_eq_const:1511; X86:       # %bb.0:1512; X86-NEXT:    pushl $481513; X86-NEXT:    pushl $.L.str1514; X86-NEXT:    pushl {{[0-9]+}}(%esp)1515; X86-NEXT:    calll memcmp1516; X86-NEXT:    addl $12, %esp1517; X86-NEXT:    testl %eax, %eax1518; X86-NEXT:    setne %al1519; X86-NEXT:    retl1520  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 48) nounwind1521  %c = icmp ne i32 %m, 01522  ret i1 %c1523}1524 1525define i32 @length63(ptr %X, ptr %Y) nounwind {1526; X86-LABEL: length63:1527; X86:       # %bb.0:1528; X86-NEXT:    pushl $631529; X86-NEXT:    pushl {{[0-9]+}}(%esp)1530; X86-NEXT:    pushl {{[0-9]+}}(%esp)1531; X86-NEXT:    calll memcmp1532; X86-NEXT:    addl $12, %esp1533; X86-NEXT:    retl1534  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 63) nounwind1535  ret i32 %m1536}1537 1538define i1 @length63_eq(ptr %x, ptr %y) nounwind {1539; X86-LABEL: length63_eq:1540; X86:       # %bb.0:1541; X86-NEXT:    pushl $631542; X86-NEXT:    pushl {{[0-9]+}}(%esp)1543; X86-NEXT:    pushl {{[0-9]+}}(%esp)1544; X86-NEXT:    calll memcmp1545; X86-NEXT:    addl $12, %esp1546; X86-NEXT:    testl %eax, %eax1547; X86-NEXT:    setne %al1548; X86-NEXT:    retl1549  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 63) nounwind1550  %cmp = icmp ne i32 %call, 01551  ret i1 %cmp1552}1553 1554define i1 @length63_lt(ptr %x, ptr %y) nounwind {1555; X86-LABEL: length63_lt:1556; X86:       # %bb.0:1557; X86-NEXT:    pushl $631558; X86-NEXT:    pushl {{[0-9]+}}(%esp)1559; X86-NEXT:    pushl {{[0-9]+}}(%esp)1560; X86-NEXT:    calll memcmp1561; X86-NEXT:    addl $12, %esp1562; X86-NEXT:    shrl $31, %eax1563; X86-NEXT:    # kill: def $al killed $al killed $eax1564; X86-NEXT:    retl1565  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 63) nounwind1566  %cmp = icmp slt i32 %call, 01567  ret i1 %cmp1568}1569 1570define i1 @length63_gt(ptr %x, ptr %y) nounwind {1571; X86-LABEL: length63_gt:1572; X86:       # %bb.0:1573; X86-NEXT:    pushl $631574; X86-NEXT:    pushl {{[0-9]+}}(%esp)1575; X86-NEXT:    pushl {{[0-9]+}}(%esp)1576; X86-NEXT:    calll memcmp1577; X86-NEXT:    addl $12, %esp1578; X86-NEXT:    testl %eax, %eax1579; X86-NEXT:    setg %al1580; X86-NEXT:    retl1581  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 63) nounwind1582  %cmp = icmp sgt i32 %call, 01583  ret i1 %cmp1584}1585 1586define i1 @length63_eq_const(ptr %X) nounwind {1587; X86-LABEL: length63_eq_const:1588; X86:       # %bb.0:1589; X86-NEXT:    pushl $631590; X86-NEXT:    pushl $.L.str1591; X86-NEXT:    pushl {{[0-9]+}}(%esp)1592; X86-NEXT:    calll memcmp1593; X86-NEXT:    addl $12, %esp1594; X86-NEXT:    testl %eax, %eax1595; X86-NEXT:    sete %al1596; X86-NEXT:    retl1597  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 63) nounwind1598  %c = icmp eq i32 %m, 01599  ret i1 %c1600}1601 1602define i32 @length64(ptr %X, ptr %Y) nounwind {1603; X86-LABEL: length64:1604; X86:       # %bb.0:1605; X86-NEXT:    pushl $641606; X86-NEXT:    pushl {{[0-9]+}}(%esp)1607; X86-NEXT:    pushl {{[0-9]+}}(%esp)1608; X86-NEXT:    calll memcmp1609; X86-NEXT:    addl $12, %esp1610; X86-NEXT:    retl1611  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 64) nounwind1612  ret i32 %m1613}1614 1615define i1 @length64_eq(ptr %x, ptr %y) nounwind {1616; X86-LABEL: length64_eq:1617; X86:       # %bb.0:1618; X86-NEXT:    pushl $641619; X86-NEXT:    pushl {{[0-9]+}}(%esp)1620; X86-NEXT:    pushl {{[0-9]+}}(%esp)1621; X86-NEXT:    calll memcmp1622; X86-NEXT:    addl $12, %esp1623; X86-NEXT:    testl %eax, %eax1624; X86-NEXT:    setne %al1625; X86-NEXT:    retl1626  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 64) nounwind1627  %cmp = icmp ne i32 %call, 01628  ret i1 %cmp1629}1630 1631define i1 @length64_lt(ptr %x, ptr %y) nounwind {1632; X86-LABEL: length64_lt:1633; X86:       # %bb.0:1634; X86-NEXT:    pushl $641635; X86-NEXT:    pushl {{[0-9]+}}(%esp)1636; X86-NEXT:    pushl {{[0-9]+}}(%esp)1637; X86-NEXT:    calll memcmp1638; X86-NEXT:    addl $12, %esp1639; X86-NEXT:    shrl $31, %eax1640; X86-NEXT:    # kill: def $al killed $al killed $eax1641; X86-NEXT:    retl1642  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 64) nounwind1643  %cmp = icmp slt i32 %call, 01644  ret i1 %cmp1645}1646 1647define i1 @length64_gt(ptr %x, ptr %y) nounwind {1648; X86-LABEL: length64_gt:1649; X86:       # %bb.0:1650; X86-NEXT:    pushl $641651; X86-NEXT:    pushl {{[0-9]+}}(%esp)1652; X86-NEXT:    pushl {{[0-9]+}}(%esp)1653; X86-NEXT:    calll memcmp1654; X86-NEXT:    addl $12, %esp1655; X86-NEXT:    testl %eax, %eax1656; X86-NEXT:    setg %al1657; X86-NEXT:    retl1658  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 64) nounwind1659  %cmp = icmp sgt i32 %call, 01660  ret i1 %cmp1661}1662 1663define i1 @length64_eq_const(ptr %X) nounwind {1664; X86-LABEL: length64_eq_const:1665; X86:       # %bb.0:1666; X86-NEXT:    pushl $641667; X86-NEXT:    pushl $.L.str1668; X86-NEXT:    pushl {{[0-9]+}}(%esp)1669; X86-NEXT:    calll memcmp1670; X86-NEXT:    addl $12, %esp1671; X86-NEXT:    testl %eax, %eax1672; X86-NEXT:    sete %al1673; X86-NEXT:    retl1674  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 64) nounwind1675  %c = icmp eq i32 %m, 01676  ret i1 %c1677}1678 1679define i32 @length96(ptr %X, ptr %Y) nounwind {1680; X86-LABEL: length96:1681; X86:       # %bb.0:1682; X86-NEXT:    pushl $961683; X86-NEXT:    pushl {{[0-9]+}}(%esp)1684; X86-NEXT:    pushl {{[0-9]+}}(%esp)1685; X86-NEXT:    calll memcmp1686; X86-NEXT:    addl $12, %esp1687; X86-NEXT:    retl1688  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 96) nounwind1689  ret i32 %m1690}1691 1692define i1 @length96_eq(ptr %x, ptr %y) nounwind {1693; X86-LABEL: length96_eq:1694; X86:       # %bb.0:1695; X86-NEXT:    pushl $961696; X86-NEXT:    pushl {{[0-9]+}}(%esp)1697; X86-NEXT:    pushl {{[0-9]+}}(%esp)1698; X86-NEXT:    calll memcmp1699; X86-NEXT:    addl $12, %esp1700; X86-NEXT:    testl %eax, %eax1701; X86-NEXT:    setne %al1702; X86-NEXT:    retl1703  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 96) nounwind1704  %cmp = icmp ne i32 %call, 01705  ret i1 %cmp1706}1707 1708define i1 @length96_lt(ptr %x, ptr %y) nounwind {1709; X86-LABEL: length96_lt:1710; X86:       # %bb.0:1711; X86-NEXT:    pushl $961712; X86-NEXT:    pushl {{[0-9]+}}(%esp)1713; X86-NEXT:    pushl {{[0-9]+}}(%esp)1714; X86-NEXT:    calll memcmp1715; X86-NEXT:    addl $12, %esp1716; X86-NEXT:    shrl $31, %eax1717; X86-NEXT:    # kill: def $al killed $al killed $eax1718; X86-NEXT:    retl1719  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 96) nounwind1720  %cmp = icmp slt i32 %call, 01721  ret i1 %cmp1722}1723 1724define i1 @length96_gt(ptr %x, ptr %y) nounwind {1725; X86-LABEL: length96_gt:1726; X86:       # %bb.0:1727; X86-NEXT:    pushl $961728; X86-NEXT:    pushl {{[0-9]+}}(%esp)1729; X86-NEXT:    pushl {{[0-9]+}}(%esp)1730; X86-NEXT:    calll memcmp1731; X86-NEXT:    addl $12, %esp1732; X86-NEXT:    testl %eax, %eax1733; X86-NEXT:    setg %al1734; X86-NEXT:    retl1735  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 96) nounwind1736  %cmp = icmp sgt i32 %call, 01737  ret i1 %cmp1738}1739 1740define i1 @length96_eq_const(ptr %X) nounwind {1741; X86-LABEL: length96_eq_const:1742; X86:       # %bb.0:1743; X86-NEXT:    pushl $961744; X86-NEXT:    pushl $.L.str1745; X86-NEXT:    pushl {{[0-9]+}}(%esp)1746; X86-NEXT:    calll memcmp1747; X86-NEXT:    addl $12, %esp1748; X86-NEXT:    testl %eax, %eax1749; X86-NEXT:    sete %al1750; X86-NEXT:    retl1751  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 96) nounwind1752  %c = icmp eq i32 %m, 01753  ret i1 %c1754}1755 1756define i32 @length127(ptr %X, ptr %Y) nounwind {1757; X86-LABEL: length127:1758; X86:       # %bb.0:1759; X86-NEXT:    pushl $1271760; X86-NEXT:    pushl {{[0-9]+}}(%esp)1761; X86-NEXT:    pushl {{[0-9]+}}(%esp)1762; X86-NEXT:    calll memcmp1763; X86-NEXT:    addl $12, %esp1764; X86-NEXT:    retl1765  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 127) nounwind1766  ret i32 %m1767}1768 1769define i1 @length127_eq(ptr %x, ptr %y) nounwind {1770; X86-LABEL: length127_eq:1771; X86:       # %bb.0:1772; X86-NEXT:    pushl $1271773; X86-NEXT:    pushl {{[0-9]+}}(%esp)1774; X86-NEXT:    pushl {{[0-9]+}}(%esp)1775; X86-NEXT:    calll memcmp1776; X86-NEXT:    addl $12, %esp1777; X86-NEXT:    testl %eax, %eax1778; X86-NEXT:    setne %al1779; X86-NEXT:    retl1780  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 127) nounwind1781  %cmp = icmp ne i32 %call, 01782  ret i1 %cmp1783}1784 1785define i1 @length127_lt(ptr %x, ptr %y) nounwind {1786; X86-LABEL: length127_lt:1787; X86:       # %bb.0:1788; X86-NEXT:    pushl $1271789; X86-NEXT:    pushl {{[0-9]+}}(%esp)1790; X86-NEXT:    pushl {{[0-9]+}}(%esp)1791; X86-NEXT:    calll memcmp1792; X86-NEXT:    addl $12, %esp1793; X86-NEXT:    shrl $31, %eax1794; X86-NEXT:    # kill: def $al killed $al killed $eax1795; X86-NEXT:    retl1796  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 127) nounwind1797  %cmp = icmp slt i32 %call, 01798  ret i1 %cmp1799}1800 1801define i1 @length127_gt(ptr %x, ptr %y) nounwind {1802; X86-LABEL: length127_gt:1803; X86:       # %bb.0:1804; X86-NEXT:    pushl $1271805; X86-NEXT:    pushl {{[0-9]+}}(%esp)1806; X86-NEXT:    pushl {{[0-9]+}}(%esp)1807; X86-NEXT:    calll memcmp1808; X86-NEXT:    addl $12, %esp1809; X86-NEXT:    testl %eax, %eax1810; X86-NEXT:    setg %al1811; X86-NEXT:    retl1812  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 127) nounwind1813  %cmp = icmp sgt i32 %call, 01814  ret i1 %cmp1815}1816 1817define i1 @length127_eq_const(ptr %X) nounwind {1818; X86-LABEL: length127_eq_const:1819; X86:       # %bb.0:1820; X86-NEXT:    pushl $1271821; X86-NEXT:    pushl $.L.str1822; X86-NEXT:    pushl {{[0-9]+}}(%esp)1823; X86-NEXT:    calll memcmp1824; X86-NEXT:    addl $12, %esp1825; X86-NEXT:    testl %eax, %eax1826; X86-NEXT:    sete %al1827; X86-NEXT:    retl1828  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 127) nounwind1829  %c = icmp eq i32 %m, 01830  ret i1 %c1831}1832 1833define i32 @length128(ptr %X, ptr %Y) nounwind {1834; X86-LABEL: length128:1835; X86:       # %bb.0:1836; X86-NEXT:    pushl $1281837; X86-NEXT:    pushl {{[0-9]+}}(%esp)1838; X86-NEXT:    pushl {{[0-9]+}}(%esp)1839; X86-NEXT:    calll memcmp1840; X86-NEXT:    addl $12, %esp1841; X86-NEXT:    retl1842  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 128) nounwind1843  ret i32 %m1844}1845 1846define i1 @length128_eq(ptr %x, ptr %y) nounwind {1847; X86-LABEL: length128_eq:1848; X86:       # %bb.0:1849; X86-NEXT:    pushl $1281850; X86-NEXT:    pushl {{[0-9]+}}(%esp)1851; X86-NEXT:    pushl {{[0-9]+}}(%esp)1852; X86-NEXT:    calll memcmp1853; X86-NEXT:    addl $12, %esp1854; X86-NEXT:    testl %eax, %eax1855; X86-NEXT:    setne %al1856; X86-NEXT:    retl1857  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 128) nounwind1858  %cmp = icmp ne i32 %call, 01859  ret i1 %cmp1860}1861 1862define i1 @length128_lt(ptr %x, ptr %y) nounwind {1863; X86-LABEL: length128_lt:1864; X86:       # %bb.0:1865; X86-NEXT:    pushl $1281866; X86-NEXT:    pushl {{[0-9]+}}(%esp)1867; X86-NEXT:    pushl {{[0-9]+}}(%esp)1868; X86-NEXT:    calll memcmp1869; X86-NEXT:    addl $12, %esp1870; X86-NEXT:    shrl $31, %eax1871; X86-NEXT:    # kill: def $al killed $al killed $eax1872; X86-NEXT:    retl1873  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 128) nounwind1874  %cmp = icmp slt i32 %call, 01875  ret i1 %cmp1876}1877 1878define i1 @length128_gt(ptr %x, ptr %y) nounwind {1879; X86-LABEL: length128_gt:1880; X86:       # %bb.0:1881; X86-NEXT:    pushl $1281882; X86-NEXT:    pushl {{[0-9]+}}(%esp)1883; X86-NEXT:    pushl {{[0-9]+}}(%esp)1884; X86-NEXT:    calll memcmp1885; X86-NEXT:    addl $12, %esp1886; X86-NEXT:    testl %eax, %eax1887; X86-NEXT:    setg %al1888; X86-NEXT:    retl1889  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 128) nounwind1890  %cmp = icmp sgt i32 %call, 01891  ret i1 %cmp1892}1893 1894define i1 @length128_eq_const(ptr %X) nounwind {1895; X86-LABEL: length128_eq_const:1896; X86:       # %bb.0:1897; X86-NEXT:    pushl $1281898; X86-NEXT:    pushl $.L.str1899; X86-NEXT:    pushl {{[0-9]+}}(%esp)1900; X86-NEXT:    calll memcmp1901; X86-NEXT:    addl $12, %esp1902; X86-NEXT:    testl %eax, %eax1903; X86-NEXT:    sete %al1904; X86-NEXT:    retl1905  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 128) nounwind1906  %c = icmp eq i32 %m, 01907  ret i1 %c1908}1909 1910define i32 @length192(ptr %X, ptr %Y) nounwind {1911; X86-LABEL: length192:1912; X86:       # %bb.0:1913; X86-NEXT:    pushl $1921914; X86-NEXT:    pushl {{[0-9]+}}(%esp)1915; X86-NEXT:    pushl {{[0-9]+}}(%esp)1916; X86-NEXT:    calll memcmp1917; X86-NEXT:    addl $12, %esp1918; X86-NEXT:    retl1919  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 192) nounwind1920  ret i32 %m1921}1922 1923define i1 @length192_eq(ptr %x, ptr %y) nounwind {1924; X86-LABEL: length192_eq:1925; X86:       # %bb.0:1926; X86-NEXT:    pushl $1921927; X86-NEXT:    pushl {{[0-9]+}}(%esp)1928; X86-NEXT:    pushl {{[0-9]+}}(%esp)1929; X86-NEXT:    calll memcmp1930; X86-NEXT:    addl $12, %esp1931; X86-NEXT:    testl %eax, %eax1932; X86-NEXT:    setne %al1933; X86-NEXT:    retl1934  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 192) nounwind1935  %cmp = icmp ne i32 %call, 01936  ret i1 %cmp1937}1938 1939define i1 @length192_lt(ptr %x, ptr %y) nounwind {1940; X86-LABEL: length192_lt:1941; X86:       # %bb.0:1942; X86-NEXT:    pushl $1921943; X86-NEXT:    pushl {{[0-9]+}}(%esp)1944; X86-NEXT:    pushl {{[0-9]+}}(%esp)1945; X86-NEXT:    calll memcmp1946; X86-NEXT:    addl $12, %esp1947; X86-NEXT:    shrl $31, %eax1948; X86-NEXT:    # kill: def $al killed $al killed $eax1949; X86-NEXT:    retl1950  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 192) nounwind1951  %cmp = icmp slt i32 %call, 01952  ret i1 %cmp1953}1954 1955define i1 @length192_gt(ptr %x, ptr %y) nounwind {1956; X86-LABEL: length192_gt:1957; X86:       # %bb.0:1958; X86-NEXT:    pushl $1921959; X86-NEXT:    pushl {{[0-9]+}}(%esp)1960; X86-NEXT:    pushl {{[0-9]+}}(%esp)1961; X86-NEXT:    calll memcmp1962; X86-NEXT:    addl $12, %esp1963; X86-NEXT:    testl %eax, %eax1964; X86-NEXT:    setg %al1965; X86-NEXT:    retl1966  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 192) nounwind1967  %cmp = icmp sgt i32 %call, 01968  ret i1 %cmp1969}1970 1971define i1 @length192_eq_const(ptr %X) nounwind {1972; X86-LABEL: length192_eq_const:1973; X86:       # %bb.0:1974; X86-NEXT:    pushl $1921975; X86-NEXT:    pushl $.L.str1976; X86-NEXT:    pushl {{[0-9]+}}(%esp)1977; X86-NEXT:    calll memcmp1978; X86-NEXT:    addl $12, %esp1979; X86-NEXT:    testl %eax, %eax1980; X86-NEXT:    sete %al1981; X86-NEXT:    retl1982  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 192) nounwind1983  %c = icmp eq i32 %m, 01984  ret i1 %c1985}1986 1987define i32 @length255(ptr %X, ptr %Y) nounwind {1988; X86-LABEL: length255:1989; X86:       # %bb.0:1990; X86-NEXT:    pushl $2551991; X86-NEXT:    pushl {{[0-9]+}}(%esp)1992; X86-NEXT:    pushl {{[0-9]+}}(%esp)1993; X86-NEXT:    calll memcmp1994; X86-NEXT:    addl $12, %esp1995; X86-NEXT:    retl1996  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 255) nounwind1997  ret i32 %m1998}1999 2000define i1 @length255_eq(ptr %x, ptr %y) nounwind {2001; X86-LABEL: length255_eq:2002; X86:       # %bb.0:2003; X86-NEXT:    pushl $2552004; X86-NEXT:    pushl {{[0-9]+}}(%esp)2005; X86-NEXT:    pushl {{[0-9]+}}(%esp)2006; X86-NEXT:    calll memcmp2007; X86-NEXT:    addl $12, %esp2008; X86-NEXT:    testl %eax, %eax2009; X86-NEXT:    setne %al2010; X86-NEXT:    retl2011  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 255) nounwind2012  %cmp = icmp ne i32 %call, 02013  ret i1 %cmp2014}2015 2016define i1 @length255_lt(ptr %x, ptr %y) nounwind {2017; X86-LABEL: length255_lt:2018; X86:       # %bb.0:2019; X86-NEXT:    pushl $2552020; X86-NEXT:    pushl {{[0-9]+}}(%esp)2021; X86-NEXT:    pushl {{[0-9]+}}(%esp)2022; X86-NEXT:    calll memcmp2023; X86-NEXT:    addl $12, %esp2024; X86-NEXT:    shrl $31, %eax2025; X86-NEXT:    # kill: def $al killed $al killed $eax2026; X86-NEXT:    retl2027  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 255) nounwind2028  %cmp = icmp slt i32 %call, 02029  ret i1 %cmp2030}2031 2032define i1 @length255_gt(ptr %x, ptr %y) nounwind {2033; X86-LABEL: length255_gt:2034; X86:       # %bb.0:2035; X86-NEXT:    pushl $2552036; X86-NEXT:    pushl {{[0-9]+}}(%esp)2037; X86-NEXT:    pushl {{[0-9]+}}(%esp)2038; X86-NEXT:    calll memcmp2039; X86-NEXT:    addl $12, %esp2040; X86-NEXT:    testl %eax, %eax2041; X86-NEXT:    setg %al2042; X86-NEXT:    retl2043  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 255) nounwind2044  %cmp = icmp sgt i32 %call, 02045  ret i1 %cmp2046}2047 2048define i1 @length255_eq_const(ptr %X) nounwind {2049; X86-LABEL: length255_eq_const:2050; X86:       # %bb.0:2051; X86-NEXT:    pushl $2552052; X86-NEXT:    pushl $.L.str2053; X86-NEXT:    pushl {{[0-9]+}}(%esp)2054; X86-NEXT:    calll memcmp2055; X86-NEXT:    addl $12, %esp2056; X86-NEXT:    testl %eax, %eax2057; X86-NEXT:    sete %al2058; X86-NEXT:    retl2059  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 255) nounwind2060  %c = icmp eq i32 %m, 02061  ret i1 %c2062}2063 2064define i32 @length256(ptr %X, ptr %Y) nounwind {2065; X86-LABEL: length256:2066; X86:       # %bb.0:2067; X86-NEXT:    pushl $256 # imm = 0x1002068; X86-NEXT:    pushl {{[0-9]+}}(%esp)2069; X86-NEXT:    pushl {{[0-9]+}}(%esp)2070; X86-NEXT:    calll memcmp2071; X86-NEXT:    addl $12, %esp2072; X86-NEXT:    retl2073  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 256) nounwind2074  ret i32 %m2075}2076 2077define i1 @length256_eq(ptr %x, ptr %y) nounwind {2078; X86-LABEL: length256_eq:2079; X86:       # %bb.0:2080; X86-NEXT:    pushl $256 # imm = 0x1002081; X86-NEXT:    pushl {{[0-9]+}}(%esp)2082; X86-NEXT:    pushl {{[0-9]+}}(%esp)2083; X86-NEXT:    calll memcmp2084; X86-NEXT:    addl $12, %esp2085; X86-NEXT:    testl %eax, %eax2086; X86-NEXT:    setne %al2087; X86-NEXT:    retl2088  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 256) nounwind2089  %cmp = icmp ne i32 %call, 02090  ret i1 %cmp2091}2092 2093define i1 @length256_lt(ptr %x, ptr %y) nounwind {2094; X86-LABEL: length256_lt:2095; X86:       # %bb.0:2096; X86-NEXT:    pushl $256 # imm = 0x1002097; X86-NEXT:    pushl {{[0-9]+}}(%esp)2098; X86-NEXT:    pushl {{[0-9]+}}(%esp)2099; X86-NEXT:    calll memcmp2100; X86-NEXT:    addl $12, %esp2101; X86-NEXT:    shrl $31, %eax2102; X86-NEXT:    # kill: def $al killed $al killed $eax2103; X86-NEXT:    retl2104  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 256) nounwind2105  %cmp = icmp slt i32 %call, 02106  ret i1 %cmp2107}2108 2109define i1 @length256_gt(ptr %x, ptr %y) nounwind {2110; X86-LABEL: length256_gt:2111; X86:       # %bb.0:2112; X86-NEXT:    pushl $256 # imm = 0x1002113; X86-NEXT:    pushl {{[0-9]+}}(%esp)2114; X86-NEXT:    pushl {{[0-9]+}}(%esp)2115; X86-NEXT:    calll memcmp2116; X86-NEXT:    addl $12, %esp2117; X86-NEXT:    testl %eax, %eax2118; X86-NEXT:    setg %al2119; X86-NEXT:    retl2120  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 256) nounwind2121  %cmp = icmp sgt i32 %call, 02122  ret i1 %cmp2123}2124 2125define i1 @length256_eq_const(ptr %X) nounwind {2126; X86-LABEL: length256_eq_const:2127; X86:       # %bb.0:2128; X86-NEXT:    pushl $256 # imm = 0x1002129; X86-NEXT:    pushl $.L.str2130; X86-NEXT:    pushl {{[0-9]+}}(%esp)2131; X86-NEXT:    calll memcmp2132; X86-NEXT:    addl $12, %esp2133; X86-NEXT:    testl %eax, %eax2134; X86-NEXT:    sete %al2135; X86-NEXT:    retl2136  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 256) nounwind2137  %c = icmp eq i32 %m, 02138  ret i1 %c2139}2140 2141define i32 @length384(ptr %X, ptr %Y) nounwind {2142; X86-LABEL: length384:2143; X86:       # %bb.0:2144; X86-NEXT:    pushl $384 # imm = 0x1802145; X86-NEXT:    pushl {{[0-9]+}}(%esp)2146; X86-NEXT:    pushl {{[0-9]+}}(%esp)2147; X86-NEXT:    calll memcmp2148; X86-NEXT:    addl $12, %esp2149; X86-NEXT:    retl2150  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 384) nounwind2151  ret i32 %m2152}2153 2154define i1 @length384_eq(ptr %x, ptr %y) nounwind {2155; X86-LABEL: length384_eq:2156; X86:       # %bb.0:2157; X86-NEXT:    pushl $384 # imm = 0x1802158; X86-NEXT:    pushl {{[0-9]+}}(%esp)2159; X86-NEXT:    pushl {{[0-9]+}}(%esp)2160; X86-NEXT:    calll memcmp2161; X86-NEXT:    addl $12, %esp2162; X86-NEXT:    testl %eax, %eax2163; X86-NEXT:    setne %al2164; X86-NEXT:    retl2165  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 384) nounwind2166  %cmp = icmp ne i32 %call, 02167  ret i1 %cmp2168}2169 2170define i1 @length384_lt(ptr %x, ptr %y) nounwind {2171; X86-LABEL: length384_lt:2172; X86:       # %bb.0:2173; X86-NEXT:    pushl $384 # imm = 0x1802174; X86-NEXT:    pushl {{[0-9]+}}(%esp)2175; X86-NEXT:    pushl {{[0-9]+}}(%esp)2176; X86-NEXT:    calll memcmp2177; X86-NEXT:    addl $12, %esp2178; X86-NEXT:    shrl $31, %eax2179; X86-NEXT:    # kill: def $al killed $al killed $eax2180; X86-NEXT:    retl2181  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 384) nounwind2182  %cmp = icmp slt i32 %call, 02183  ret i1 %cmp2184}2185 2186define i1 @length384_gt(ptr %x, ptr %y) nounwind {2187; X86-LABEL: length384_gt:2188; X86:       # %bb.0:2189; X86-NEXT:    pushl $384 # imm = 0x1802190; X86-NEXT:    pushl {{[0-9]+}}(%esp)2191; X86-NEXT:    pushl {{[0-9]+}}(%esp)2192; X86-NEXT:    calll memcmp2193; X86-NEXT:    addl $12, %esp2194; X86-NEXT:    testl %eax, %eax2195; X86-NEXT:    setg %al2196; X86-NEXT:    retl2197  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 384) nounwind2198  %cmp = icmp sgt i32 %call, 02199  ret i1 %cmp2200}2201 2202define i1 @length384_eq_const(ptr %X) nounwind {2203; X86-LABEL: length384_eq_const:2204; X86:       # %bb.0:2205; X86-NEXT:    pushl $384 # imm = 0x1802206; X86-NEXT:    pushl $.L.str2207; X86-NEXT:    pushl {{[0-9]+}}(%esp)2208; X86-NEXT:    calll memcmp2209; X86-NEXT:    addl $12, %esp2210; X86-NEXT:    testl %eax, %eax2211; X86-NEXT:    sete %al2212; X86-NEXT:    retl2213  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 384) nounwind2214  %c = icmp eq i32 %m, 02215  ret i1 %c2216}2217 2218define i32 @length511(ptr %X, ptr %Y) nounwind {2219; X86-LABEL: length511:2220; X86:       # %bb.0:2221; X86-NEXT:    pushl $511 # imm = 0x1FF2222; X86-NEXT:    pushl {{[0-9]+}}(%esp)2223; X86-NEXT:    pushl {{[0-9]+}}(%esp)2224; X86-NEXT:    calll memcmp2225; X86-NEXT:    addl $12, %esp2226; X86-NEXT:    retl2227  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 511) nounwind2228  ret i32 %m2229}2230 2231define i1 @length511_eq(ptr %x, ptr %y) nounwind {2232; X86-LABEL: length511_eq:2233; X86:       # %bb.0:2234; X86-NEXT:    pushl $511 # imm = 0x1FF2235; X86-NEXT:    pushl {{[0-9]+}}(%esp)2236; X86-NEXT:    pushl {{[0-9]+}}(%esp)2237; X86-NEXT:    calll memcmp2238; X86-NEXT:    addl $12, %esp2239; X86-NEXT:    testl %eax, %eax2240; X86-NEXT:    setne %al2241; X86-NEXT:    retl2242  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 511) nounwind2243  %cmp = icmp ne i32 %call, 02244  ret i1 %cmp2245}2246 2247define i1 @length511_lt(ptr %x, ptr %y) nounwind {2248; X86-LABEL: length511_lt:2249; X86:       # %bb.0:2250; X86-NEXT:    pushl $511 # imm = 0x1FF2251; X86-NEXT:    pushl {{[0-9]+}}(%esp)2252; X86-NEXT:    pushl {{[0-9]+}}(%esp)2253; X86-NEXT:    calll memcmp2254; X86-NEXT:    addl $12, %esp2255; X86-NEXT:    shrl $31, %eax2256; X86-NEXT:    # kill: def $al killed $al killed $eax2257; X86-NEXT:    retl2258  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 511) nounwind2259  %cmp = icmp slt i32 %call, 02260  ret i1 %cmp2261}2262 2263define i1 @length511_gt(ptr %x, ptr %y) nounwind {2264; X86-LABEL: length511_gt:2265; X86:       # %bb.0:2266; X86-NEXT:    pushl $511 # imm = 0x1FF2267; X86-NEXT:    pushl {{[0-9]+}}(%esp)2268; X86-NEXT:    pushl {{[0-9]+}}(%esp)2269; X86-NEXT:    calll memcmp2270; X86-NEXT:    addl $12, %esp2271; X86-NEXT:    testl %eax, %eax2272; X86-NEXT:    setg %al2273; X86-NEXT:    retl2274  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 511) nounwind2275  %cmp = icmp sgt i32 %call, 02276  ret i1 %cmp2277}2278 2279define i1 @length511_eq_const(ptr %X) nounwind {2280; X86-LABEL: length511_eq_const:2281; X86:       # %bb.0:2282; X86-NEXT:    pushl $511 # imm = 0x1FF2283; X86-NEXT:    pushl $.L.str2284; X86-NEXT:    pushl {{[0-9]+}}(%esp)2285; X86-NEXT:    calll memcmp2286; X86-NEXT:    addl $12, %esp2287; X86-NEXT:    testl %eax, %eax2288; X86-NEXT:    sete %al2289; X86-NEXT:    retl2290  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 511) nounwind2291  %c = icmp eq i32 %m, 02292  ret i1 %c2293}2294 2295define i32 @length512(ptr %X, ptr %Y) nounwind {2296; X86-LABEL: length512:2297; X86:       # %bb.0:2298; X86-NEXT:    pushl $512 # imm = 0x2002299; X86-NEXT:    pushl {{[0-9]+}}(%esp)2300; X86-NEXT:    pushl {{[0-9]+}}(%esp)2301; X86-NEXT:    calll memcmp2302; X86-NEXT:    addl $12, %esp2303; X86-NEXT:    retl2304  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 512) nounwind2305  ret i32 %m2306}2307 2308define i1 @length512_eq(ptr %x, ptr %y) nounwind {2309; X86-LABEL: length512_eq:2310; X86:       # %bb.0:2311; X86-NEXT:    pushl $512 # imm = 0x2002312; X86-NEXT:    pushl {{[0-9]+}}(%esp)2313; X86-NEXT:    pushl {{[0-9]+}}(%esp)2314; X86-NEXT:    calll memcmp2315; X86-NEXT:    addl $12, %esp2316; X86-NEXT:    testl %eax, %eax2317; X86-NEXT:    setne %al2318; X86-NEXT:    retl2319  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 512) nounwind2320  %cmp = icmp ne i32 %call, 02321  ret i1 %cmp2322}2323 2324define i1 @length512_lt(ptr %x, ptr %y) nounwind {2325; X86-LABEL: length512_lt:2326; X86:       # %bb.0:2327; X86-NEXT:    pushl $512 # imm = 0x2002328; X86-NEXT:    pushl {{[0-9]+}}(%esp)2329; X86-NEXT:    pushl {{[0-9]+}}(%esp)2330; X86-NEXT:    calll memcmp2331; X86-NEXT:    addl $12, %esp2332; X86-NEXT:    shrl $31, %eax2333; X86-NEXT:    # kill: def $al killed $al killed $eax2334; X86-NEXT:    retl2335  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 512) nounwind2336  %cmp = icmp slt i32 %call, 02337  ret i1 %cmp2338}2339 2340define i1 @length512_gt(ptr %x, ptr %y) nounwind {2341; X86-LABEL: length512_gt:2342; X86:       # %bb.0:2343; X86-NEXT:    pushl $512 # imm = 0x2002344; X86-NEXT:    pushl {{[0-9]+}}(%esp)2345; X86-NEXT:    pushl {{[0-9]+}}(%esp)2346; X86-NEXT:    calll memcmp2347; X86-NEXT:    addl $12, %esp2348; X86-NEXT:    testl %eax, %eax2349; X86-NEXT:    setg %al2350; X86-NEXT:    retl2351  %call = tail call i32 @memcmp(ptr %x, ptr %y, i32 512) nounwind2352  %cmp = icmp sgt i32 %call, 02353  ret i1 %cmp2354}2355 2356define i1 @length512_eq_const(ptr %X) nounwind {2357; X86-LABEL: length512_eq_const:2358; X86:       # %bb.0:2359; X86-NEXT:    pushl $512 # imm = 0x2002360; X86-NEXT:    pushl $.L.str2361; X86-NEXT:    pushl {{[0-9]+}}(%esp)2362; X86-NEXT:    calll memcmp2363; X86-NEXT:    addl $12, %esp2364; X86-NEXT:    testl %eax, %eax2365; X86-NEXT:    sete %al2366; X86-NEXT:    retl2367  %m = tail call i32 @memcmp(ptr %X, ptr @.str, i32 512) nounwind2368  %c = icmp eq i32 %m, 02369  ret i1 %c2370}2371 2372; This checks that we do not do stupid things with huge sizes.2373define i32 @huge_length(ptr %X, ptr %Y) nounwind {2374; X86-LABEL: huge_length:2375; X86:       # %bb.0:2376; X86-NEXT:    pushl $-12377; X86-NEXT:    pushl {{[0-9]+}}(%esp)2378; X86-NEXT:    pushl {{[0-9]+}}(%esp)2379; X86-NEXT:    calll memcmp2380; X86-NEXT:    addl $12, %esp2381; X86-NEXT:    retl2382  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 9223372036854775807) nounwind2383  ret i32 %m2384}2385 2386define i1 @huge_length_eq(ptr %X, ptr %Y) nounwind {2387; X86-LABEL: huge_length_eq:2388; X86:       # %bb.0:2389; X86-NEXT:    pushl $-12390; X86-NEXT:    pushl {{[0-9]+}}(%esp)2391; X86-NEXT:    pushl {{[0-9]+}}(%esp)2392; X86-NEXT:    calll memcmp2393; X86-NEXT:    addl $12, %esp2394; X86-NEXT:    testl %eax, %eax2395; X86-NEXT:    sete %al2396; X86-NEXT:    retl2397  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 9223372036854775807) nounwind2398  %c = icmp eq i32 %m, 02399  ret i1 %c2400}2401 2402; This checks non-constant sizes.2403define i32 @nonconst_length(ptr %X, ptr %Y, i32 %size) nounwind {2404; X86-LABEL: nonconst_length:2405; X86:       # %bb.0:2406; X86-NEXT:    jmp memcmp # TAILCALL2407  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 %size) nounwind2408  ret i32 %m2409}2410 2411define i1 @nonconst_length_eq(ptr %X, ptr %Y, i32 %size) nounwind {2412; X86-LABEL: nonconst_length_eq:2413; X86:       # %bb.0:2414; X86-NEXT:    pushl {{[0-9]+}}(%esp)2415; X86-NEXT:    pushl {{[0-9]+}}(%esp)2416; X86-NEXT:    pushl {{[0-9]+}}(%esp)2417; X86-NEXT:    calll memcmp2418; X86-NEXT:    addl $12, %esp2419; X86-NEXT:    testl %eax, %eax2420; X86-NEXT:    sete %al2421; X86-NEXT:    retl2422  %m = tail call i32 @memcmp(ptr %X, ptr %Y, i32 %size) nounwind2423  %c = icmp eq i32 %m, 02424  ret i1 %c2425}2426