brintos

brintos / llvm-project-archived public Read only

0
0
Text · 23.4 KiB · a663f6a Raw
838 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X863; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X644 5define i16 @test_mul_by_1(i16 %x) {6; X86-LABEL: test_mul_by_1:7; X86:       # %bb.0:8; X86-NEXT:    movzwl {{[0-9]+}}(%esp), %eax9; X86-NEXT:    retl10;11; X64-LABEL: test_mul_by_1:12; X64:       # %bb.0:13; X64-NEXT:    movl %edi, %eax14; X64-NEXT:    # kill: def $ax killed $ax killed $eax15; X64-NEXT:    retq16  %mul = mul nsw i16 %x, 117  ret i16 %mul18}19 20define i16 @test_mul_by_2(i16 %x) {21; X86-LABEL: test_mul_by_2:22; X86:       # %bb.0:23; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax24; X86-NEXT:    addl %eax, %eax25; X86-NEXT:    # kill: def $ax killed $ax killed $eax26; X86-NEXT:    retl27;28; X64-LABEL: test_mul_by_2:29; X64:       # %bb.0:30; X64-NEXT:    # kill: def $edi killed $edi def $rdi31; X64-NEXT:    leal (%rdi,%rdi), %eax32; X64-NEXT:    # kill: def $ax killed $ax killed $eax33; X64-NEXT:    retq34  %mul = mul nsw i16 %x, 235  ret i16 %mul36}37 38define i16 @test_mul_by_3(i16 %x) {39; X86-LABEL: test_mul_by_3:40; X86:       # %bb.0:41; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax42; X86-NEXT:    leal (%eax,%eax,2), %eax43; X86-NEXT:    # kill: def $ax killed $ax killed $eax44; X86-NEXT:    retl45;46; X64-LABEL: test_mul_by_3:47; X64:       # %bb.0:48; X64-NEXT:    # kill: def $edi killed $edi def $rdi49; X64-NEXT:    leal (%rdi,%rdi,2), %eax50; X64-NEXT:    # kill: def $ax killed $ax killed $eax51; X64-NEXT:    retq52  %mul = mul nsw i16 %x, 353  ret i16 %mul54}55 56define i16 @test_mul_by_4(i16 %x) {57; X86-LABEL: test_mul_by_4:58; X86:       # %bb.0:59; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax60; X86-NEXT:    shll $2, %eax61; X86-NEXT:    # kill: def $ax killed $ax killed $eax62; X86-NEXT:    retl63;64; X64-LABEL: test_mul_by_4:65; X64:       # %bb.0:66; X64-NEXT:    # kill: def $edi killed $edi def $rdi67; X64-NEXT:    leal (,%rdi,4), %eax68; X64-NEXT:    # kill: def $ax killed $ax killed $eax69; X64-NEXT:    retq70  %mul = mul nsw i16 %x, 471  ret i16 %mul72}73 74define i16 @test_mul_by_5(i16 %x) {75; X86-LABEL: test_mul_by_5:76; X86:       # %bb.0:77; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax78; X86-NEXT:    leal (%eax,%eax,4), %eax79; X86-NEXT:    # kill: def $ax killed $ax killed $eax80; X86-NEXT:    retl81;82; X64-LABEL: test_mul_by_5:83; X64:       # %bb.0:84; X64-NEXT:    # kill: def $edi killed $edi def $rdi85; X64-NEXT:    leal (%rdi,%rdi,4), %eax86; X64-NEXT:    # kill: def $ax killed $ax killed $eax87; X64-NEXT:    retq88  %mul = mul nsw i16 %x, 589  ret i16 %mul90}91 92define i16 @test_mul_by_6(i16 %x) {93; X86-LABEL: test_mul_by_6:94; X86:       # %bb.0:95; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax96; X86-NEXT:    addl %eax, %eax97; X86-NEXT:    leal (%eax,%eax,2), %eax98; X86-NEXT:    # kill: def $ax killed $ax killed $eax99; X86-NEXT:    retl100;101; X64-LABEL: test_mul_by_6:102; X64:       # %bb.0:103; X64-NEXT:    # kill: def $edi killed $edi def $rdi104; X64-NEXT:    addl %edi, %edi105; X64-NEXT:    leal (%rdi,%rdi,2), %eax106; X64-NEXT:    # kill: def $ax killed $ax killed $eax107; X64-NEXT:    retq108  %mul = mul nsw i16 %x, 6109  ret i16 %mul110}111 112define i16 @test_mul_by_7(i16 %x) {113; X86-LABEL: test_mul_by_7:114; X86:       # %bb.0:115; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx116; X86-NEXT:    leal (,%ecx,8), %eax117; X86-NEXT:    subl %ecx, %eax118; X86-NEXT:    # kill: def $ax killed $ax killed $eax119; X86-NEXT:    retl120;121; X64-LABEL: test_mul_by_7:122; X64:       # %bb.0:123; X64-NEXT:    # kill: def $edi killed $edi def $rdi124; X64-NEXT:    leal (,%rdi,8), %eax125; X64-NEXT:    subl %edi, %eax126; X64-NEXT:    # kill: def $ax killed $ax killed $eax127; X64-NEXT:    retq128  %mul = mul nsw i16 %x, 7129  ret i16 %mul130}131 132define i16 @test_mul_by_8(i16 %x) {133; X86-LABEL: test_mul_by_8:134; X86:       # %bb.0:135; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax136; X86-NEXT:    shll $3, %eax137; X86-NEXT:    # kill: def $ax killed $ax killed $eax138; X86-NEXT:    retl139;140; X64-LABEL: test_mul_by_8:141; X64:       # %bb.0:142; X64-NEXT:    # kill: def $edi killed $edi def $rdi143; X64-NEXT:    leal (,%rdi,8), %eax144; X64-NEXT:    # kill: def $ax killed $ax killed $eax145; X64-NEXT:    retq146  %mul = mul nsw i16 %x, 8147  ret i16 %mul148}149 150define i16 @test_mul_by_9(i16 %x) {151; X86-LABEL: test_mul_by_9:152; X86:       # %bb.0:153; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax154; X86-NEXT:    leal (%eax,%eax,8), %eax155; X86-NEXT:    # kill: def $ax killed $ax killed $eax156; X86-NEXT:    retl157;158; X64-LABEL: test_mul_by_9:159; X64:       # %bb.0:160; X64-NEXT:    # kill: def $edi killed $edi def $rdi161; X64-NEXT:    leal (%rdi,%rdi,8), %eax162; X64-NEXT:    # kill: def $ax killed $ax killed $eax163; X64-NEXT:    retq164  %mul = mul nsw i16 %x, 9165  ret i16 %mul166}167 168define i16 @test_mul_by_10(i16 %x) {169; X86-LABEL: test_mul_by_10:170; X86:       # %bb.0:171; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax172; X86-NEXT:    addl %eax, %eax173; X86-NEXT:    leal (%eax,%eax,4), %eax174; X86-NEXT:    # kill: def $ax killed $ax killed $eax175; X86-NEXT:    retl176;177; X64-LABEL: test_mul_by_10:178; X64:       # %bb.0:179; X64-NEXT:    # kill: def $edi killed $edi def $rdi180; X64-NEXT:    addl %edi, %edi181; X64-NEXT:    leal (%rdi,%rdi,4), %eax182; X64-NEXT:    # kill: def $ax killed $ax killed $eax183; X64-NEXT:    retq184  %mul = mul nsw i16 %x, 10185  ret i16 %mul186}187 188define i16 @test_mul_by_11(i16 %x) {189; X86-LABEL: test_mul_by_11:190; X86:       # %bb.0:191; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax192; X86-NEXT:    leal (%eax,%eax,4), %ecx193; X86-NEXT:    leal (%eax,%ecx,2), %eax194; X86-NEXT:    # kill: def $ax killed $ax killed $eax195; X86-NEXT:    retl196;197; X64-LABEL: test_mul_by_11:198; X64:       # %bb.0:199; X64-NEXT:    # kill: def $edi killed $edi def $rdi200; X64-NEXT:    leal (%rdi,%rdi,4), %eax201; X64-NEXT:    leal (%rdi,%rax,2), %eax202; X64-NEXT:    # kill: def $ax killed $ax killed $eax203; X64-NEXT:    retq204  %mul = mul nsw i16 %x, 11205  ret i16 %mul206}207 208define i16 @test_mul_by_12(i16 %x) {209; X86-LABEL: test_mul_by_12:210; X86:       # %bb.0:211; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax212; X86-NEXT:    shll $2, %eax213; X86-NEXT:    leal (%eax,%eax,2), %eax214; X86-NEXT:    # kill: def $ax killed $ax killed $eax215; X86-NEXT:    retl216;217; X64-LABEL: test_mul_by_12:218; X64:       # %bb.0:219; X64-NEXT:    # kill: def $edi killed $edi def $rdi220; X64-NEXT:    shll $2, %edi221; X64-NEXT:    leal (%rdi,%rdi,2), %eax222; X64-NEXT:    # kill: def $ax killed $ax killed $eax223; X64-NEXT:    retq224  %mul = mul nsw i16 %x, 12225  ret i16 %mul226}227 228define i16 @test_mul_by_13(i16 %x) {229; X86-LABEL: test_mul_by_13:230; X86:       # %bb.0:231; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax232; X86-NEXT:    leal (%eax,%eax,2), %ecx233; X86-NEXT:    leal (%eax,%ecx,4), %eax234; X86-NEXT:    # kill: def $ax killed $ax killed $eax235; X86-NEXT:    retl236;237; X64-LABEL: test_mul_by_13:238; X64:       # %bb.0:239; X64-NEXT:    # kill: def $edi killed $edi def $rdi240; X64-NEXT:    leal (%rdi,%rdi,2), %eax241; X64-NEXT:    leal (%rdi,%rax,4), %eax242; X64-NEXT:    # kill: def $ax killed $ax killed $eax243; X64-NEXT:    retq244  %mul = mul nsw i16 %x, 13245  ret i16 %mul246}247 248define i16 @test_mul_by_14(i16 %x) {249; X86-LABEL: test_mul_by_14:250; X86:       # %bb.0:251; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax252; X86-NEXT:    leal (%eax,%eax), %ecx253; X86-NEXT:    shll $4, %eax254; X86-NEXT:    subl %ecx, %eax255; X86-NEXT:    # kill: def $ax killed $ax killed $eax256; X86-NEXT:    retl257;258; X64-LABEL: test_mul_by_14:259; X64:       # %bb.0:260; X64-NEXT:    movl %edi, %eax261; X64-NEXT:    leal (%rax,%rax), %ecx262; X64-NEXT:    shll $4, %eax263; X64-NEXT:    subl %ecx, %eax264; X64-NEXT:    # kill: def $ax killed $ax killed $rax265; X64-NEXT:    retq266  %mul = mul nsw i16 %x, 14267  ret i16 %mul268}269 270define i16 @test_mul_by_15(i16 %x) {271; X86-LABEL: test_mul_by_15:272; X86:       # %bb.0:273; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax274; X86-NEXT:    leal (%eax,%eax,4), %eax275; X86-NEXT:    leal (%eax,%eax,2), %eax276; X86-NEXT:    # kill: def $ax killed $ax killed $eax277; X86-NEXT:    retl278;279; X64-LABEL: test_mul_by_15:280; X64:       # %bb.0:281; X64-NEXT:    # kill: def $edi killed $edi def $rdi282; X64-NEXT:    leal (%rdi,%rdi,4), %eax283; X64-NEXT:    leal (%rax,%rax,2), %eax284; X64-NEXT:    # kill: def $ax killed $ax killed $eax285; X64-NEXT:    retq286  %mul = mul nsw i16 %x, 15287  ret i16 %mul288}289 290define i16 @test_mul_by_16(i16 %x) {291; X86-LABEL: test_mul_by_16:292; X86:       # %bb.0:293; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax294; X86-NEXT:    shll $4, %eax295; X86-NEXT:    # kill: def $ax killed $ax killed $eax296; X86-NEXT:    retl297;298; X64-LABEL: test_mul_by_16:299; X64:       # %bb.0:300; X64-NEXT:    movl %edi, %eax301; X64-NEXT:    shll $4, %eax302; X64-NEXT:    # kill: def $ax killed $ax killed $eax303; X64-NEXT:    retq304  %mul = mul nsw i16 %x, 16305  ret i16 %mul306}307 308define i16 @test_mul_by_17(i16 %x) {309; X86-LABEL: test_mul_by_17:310; X86:       # %bb.0:311; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx312; X86-NEXT:    movl %ecx, %eax313; X86-NEXT:    shll $4, %eax314; X86-NEXT:    addl %ecx, %eax315; X86-NEXT:    # kill: def $ax killed $ax killed $eax316; X86-NEXT:    retl317;318; X64-LABEL: test_mul_by_17:319; X64:       # %bb.0:320; X64-NEXT:    movl %edi, %eax321; X64-NEXT:    shll $4, %eax322; X64-NEXT:    addl %edi, %eax323; X64-NEXT:    # kill: def $ax killed $ax killed $eax324; X64-NEXT:    retq325  %mul = mul nsw i16 %x, 17326  ret i16 %mul327}328 329define i16 @test_mul_by_18(i16 %x) {330; X86-LABEL: test_mul_by_18:331; X86:       # %bb.0:332; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax333; X86-NEXT:    addl %eax, %eax334; X86-NEXT:    leal (%eax,%eax,8), %eax335; X86-NEXT:    # kill: def $ax killed $ax killed $eax336; X86-NEXT:    retl337;338; X64-LABEL: test_mul_by_18:339; X64:       # %bb.0:340; X64-NEXT:    # kill: def $edi killed $edi def $rdi341; X64-NEXT:    addl %edi, %edi342; X64-NEXT:    leal (%rdi,%rdi,8), %eax343; X64-NEXT:    # kill: def $ax killed $ax killed $eax344; X64-NEXT:    retq345  %mul = mul nsw i16 %x, 18346  ret i16 %mul347}348 349define i16 @test_mul_by_19(i16 %x) {350; X86-LABEL: test_mul_by_19:351; X86:       # %bb.0:352; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax353; X86-NEXT:    leal (%eax,%eax,8), %ecx354; X86-NEXT:    leal (%eax,%ecx,2), %eax355; X86-NEXT:    # kill: def $ax killed $ax killed $eax356; X86-NEXT:    retl357;358; X64-LABEL: test_mul_by_19:359; X64:       # %bb.0:360; X64-NEXT:    # kill: def $edi killed $edi def $rdi361; X64-NEXT:    leal (%rdi,%rdi,8), %eax362; X64-NEXT:    leal (%rdi,%rax,2), %eax363; X64-NEXT:    # kill: def $ax killed $ax killed $eax364; X64-NEXT:    retq365  %mul = mul nsw i16 %x, 19366  ret i16 %mul367}368 369define i16 @test_mul_by_20(i16 %x) {370; X86-LABEL: test_mul_by_20:371; X86:       # %bb.0:372; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax373; X86-NEXT:    shll $2, %eax374; X86-NEXT:    leal (%eax,%eax,4), %eax375; X86-NEXT:    # kill: def $ax killed $ax killed $eax376; X86-NEXT:    retl377;378; X64-LABEL: test_mul_by_20:379; X64:       # %bb.0:380; X64-NEXT:    # kill: def $edi killed $edi def $rdi381; X64-NEXT:    shll $2, %edi382; X64-NEXT:    leal (%rdi,%rdi,4), %eax383; X64-NEXT:    # kill: def $ax killed $ax killed $eax384; X64-NEXT:    retq385  %mul = mul nsw i16 %x, 20386  ret i16 %mul387}388 389define i16 @test_mul_by_21(i16 %x) {390; X86-LABEL: test_mul_by_21:391; X86:       # %bb.0:392; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax393; X86-NEXT:    leal (%eax,%eax,4), %ecx394; X86-NEXT:    leal (%eax,%ecx,4), %eax395; X86-NEXT:    # kill: def $ax killed $ax killed $eax396; X86-NEXT:    retl397;398; X64-LABEL: test_mul_by_21:399; X64:       # %bb.0:400; X64-NEXT:    # kill: def $edi killed $edi def $rdi401; X64-NEXT:    leal (%rdi,%rdi,4), %eax402; X64-NEXT:    leal (%rdi,%rax,4), %eax403; X64-NEXT:    # kill: def $ax killed $ax killed $eax404; X64-NEXT:    retq405  %mul = mul nsw i16 %x, 21406  ret i16 %mul407}408 409define i16 @test_mul_by_22(i16 %x) {410; X86-LABEL: test_mul_by_22:411; X86:       # %bb.0:412; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx413; X86-NEXT:    leal (%ecx,%ecx,4), %eax414; X86-NEXT:    leal (%ecx,%eax,4), %eax415; X86-NEXT:    addl %ecx, %eax416; X86-NEXT:    # kill: def $ax killed $ax killed $eax417; X86-NEXT:    retl418;419; X64-LABEL: test_mul_by_22:420; X64:       # %bb.0:421; X64-NEXT:    # kill: def $edi killed $edi def $rdi422; X64-NEXT:    leal (%rdi,%rdi,4), %eax423; X64-NEXT:    leal (%rdi,%rax,4), %eax424; X64-NEXT:    addl %edi, %eax425; X64-NEXT:    # kill: def $ax killed $ax killed $eax426; X64-NEXT:    retq427  %mul = mul nsw i16 %x, 22428  ret i16 %mul429}430 431define i16 @test_mul_by_23(i16 %x) {432; X86-LABEL: test_mul_by_23:433; X86:       # %bb.0:434; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx435; X86-NEXT:    leal (%ecx,%ecx,2), %eax436; X86-NEXT:    shll $3, %eax437; X86-NEXT:    subl %ecx, %eax438; X86-NEXT:    # kill: def $ax killed $ax killed $eax439; X86-NEXT:    retl440;441; X64-LABEL: test_mul_by_23:442; X64:       # %bb.0:443; X64-NEXT:    # kill: def $edi killed $edi def $rdi444; X64-NEXT:    leal (%rdi,%rdi,2), %eax445; X64-NEXT:    shll $3, %eax446; X64-NEXT:    subl %edi, %eax447; X64-NEXT:    # kill: def $ax killed $ax killed $eax448; X64-NEXT:    retq449  %mul = mul nsw i16 %x, 23450  ret i16 %mul451}452 453define i16 @test_mul_by_24(i16 %x) {454; X86-LABEL: test_mul_by_24:455; X86:       # %bb.0:456; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax457; X86-NEXT:    shll $3, %eax458; X86-NEXT:    leal (%eax,%eax,2), %eax459; X86-NEXT:    # kill: def $ax killed $ax killed $eax460; X86-NEXT:    retl461;462; X64-LABEL: test_mul_by_24:463; X64:       # %bb.0:464; X64-NEXT:    # kill: def $edi killed $edi def $rdi465; X64-NEXT:    shll $3, %edi466; X64-NEXT:    leal (%rdi,%rdi,2), %eax467; X64-NEXT:    # kill: def $ax killed $ax killed $eax468; X64-NEXT:    retq469  %mul = mul nsw i16 %x, 24470  ret i16 %mul471}472 473define i16 @test_mul_by_25(i16 %x) {474; X86-LABEL: test_mul_by_25:475; X86:       # %bb.0:476; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax477; X86-NEXT:    leal (%eax,%eax,4), %eax478; X86-NEXT:    leal (%eax,%eax,4), %eax479; X86-NEXT:    # kill: def $ax killed $ax killed $eax480; X86-NEXT:    retl481;482; X64-LABEL: test_mul_by_25:483; X64:       # %bb.0:484; X64-NEXT:    # kill: def $edi killed $edi def $rdi485; X64-NEXT:    leal (%rdi,%rdi,4), %eax486; X64-NEXT:    leal (%rax,%rax,4), %eax487; X64-NEXT:    # kill: def $ax killed $ax killed $eax488; X64-NEXT:    retq489  %mul = mul nsw i16 %x, 25490  ret i16 %mul491}492 493define i16 @test_mul_by_26(i16 %x) {494; X86-LABEL: test_mul_by_26:495; X86:       # %bb.0:496; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx497; X86-NEXT:    leal (%ecx,%ecx,4), %eax498; X86-NEXT:    leal (%eax,%eax,4), %eax499; X86-NEXT:    addl %ecx, %eax500; X86-NEXT:    # kill: def $ax killed $ax killed $eax501; X86-NEXT:    retl502;503; X64-LABEL: test_mul_by_26:504; X64:       # %bb.0:505; X64-NEXT:    # kill: def $edi killed $edi def $rdi506; X64-NEXT:    leal (%rdi,%rdi,4), %eax507; X64-NEXT:    leal (%rax,%rax,4), %eax508; X64-NEXT:    addl %edi, %eax509; X64-NEXT:    # kill: def $ax killed $ax killed $eax510; X64-NEXT:    retq511  %mul = mul nsw i16 %x, 26512  ret i16 %mul513}514 515define i16 @test_mul_by_27(i16 %x) {516; X86-LABEL: test_mul_by_27:517; X86:       # %bb.0:518; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax519; X86-NEXT:    leal (%eax,%eax,8), %eax520; X86-NEXT:    leal (%eax,%eax,2), %eax521; X86-NEXT:    # kill: def $ax killed $ax killed $eax522; X86-NEXT:    retl523;524; X64-LABEL: test_mul_by_27:525; X64:       # %bb.0:526; X64-NEXT:    # kill: def $edi killed $edi def $rdi527; X64-NEXT:    leal (%rdi,%rdi,8), %eax528; X64-NEXT:    leal (%rax,%rax,2), %eax529; X64-NEXT:    # kill: def $ax killed $ax killed $eax530; X64-NEXT:    retq531  %mul = mul nsw i16 %x, 27532  ret i16 %mul533}534 535define i16 @test_mul_by_28(i16 %x) {536; X86-LABEL: test_mul_by_28:537; X86:       # %bb.0:538; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx539; X86-NEXT:    leal (%ecx,%ecx,8), %eax540; X86-NEXT:    leal (%eax,%eax,2), %eax541; X86-NEXT:    addl %ecx, %eax542; X86-NEXT:    # kill: def $ax killed $ax killed $eax543; X86-NEXT:    retl544;545; X64-LABEL: test_mul_by_28:546; X64:       # %bb.0:547; X64-NEXT:    # kill: def $edi killed $edi def $rdi548; X64-NEXT:    leal (%rdi,%rdi,8), %eax549; X64-NEXT:    leal (%rax,%rax,2), %eax550; X64-NEXT:    addl %edi, %eax551; X64-NEXT:    # kill: def $ax killed $ax killed $eax552; X64-NEXT:    retq553  %mul = mul nsw i16 %x, 28554  ret i16 %mul555}556 557define i16 @test_mul_by_29(i16 %x) {558; X86-LABEL: test_mul_by_29:559; X86:       # %bb.0:560; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax561; X86-NEXT:    leal (%eax,%eax,8), %ecx562; X86-NEXT:    leal (%ecx,%ecx,2), %ecx563; X86-NEXT:    addl %eax, %eax564; X86-NEXT:    addl %ecx, %eax565; X86-NEXT:    # kill: def $ax killed $ax killed $eax566; X86-NEXT:    retl567;568; X64-LABEL: test_mul_by_29:569; X64:       # %bb.0:570; X64-NEXT:    # kill: def $edi killed $edi def $rdi571; X64-NEXT:    leal (%rdi,%rdi,8), %eax572; X64-NEXT:    leal (%rax,%rax,2), %eax573; X64-NEXT:    addl %edi, %eax574; X64-NEXT:    addl %edi, %eax575; X64-NEXT:    # kill: def $ax killed $ax killed $eax576; X64-NEXT:    retq577  %mul = mul nsw i16 %x, 29578  ret i16 %mul579}580 581define i16 @test_mul_by_30(i16 %x) {582; X86-LABEL: test_mul_by_30:583; X86:       # %bb.0:584; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax585; X86-NEXT:    leal (%eax,%eax), %ecx586; X86-NEXT:    shll $5, %eax587; X86-NEXT:    subl %ecx, %eax588; X86-NEXT:    # kill: def $ax killed $ax killed $eax589; X86-NEXT:    retl590;591; X64-LABEL: test_mul_by_30:592; X64:       # %bb.0:593; X64-NEXT:    movl %edi, %eax594; X64-NEXT:    leal (%rax,%rax), %ecx595; X64-NEXT:    shll $5, %eax596; X64-NEXT:    subl %ecx, %eax597; X64-NEXT:    # kill: def $ax killed $ax killed $rax598; X64-NEXT:    retq599  %mul = mul nsw i16 %x, 30600  ret i16 %mul601}602 603define i16 @test_mul_by_31(i16 %x) {604; X86-LABEL: test_mul_by_31:605; X86:       # %bb.0:606; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx607; X86-NEXT:    movl %ecx, %eax608; X86-NEXT:    shll $5, %eax609; X86-NEXT:    subl %ecx, %eax610; X86-NEXT:    # kill: def $ax killed $ax killed $eax611; X86-NEXT:    retl612;613; X64-LABEL: test_mul_by_31:614; X64:       # %bb.0:615; X64-NEXT:    movl %edi, %eax616; X64-NEXT:    shll $5, %eax617; X64-NEXT:    subl %edi, %eax618; X64-NEXT:    # kill: def $ax killed $ax killed $eax619; X64-NEXT:    retq620  %mul = mul nsw i16 %x, 31621  ret i16 %mul622}623 624define i16 @test_mul_by_32(i16 %x) {625; X86-LABEL: test_mul_by_32:626; X86:       # %bb.0:627; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax628; X86-NEXT:    shll $5, %eax629; X86-NEXT:    # kill: def $ax killed $ax killed $eax630; X86-NEXT:    retl631;632; X64-LABEL: test_mul_by_32:633; X64:       # %bb.0:634; X64-NEXT:    movl %edi, %eax635; X64-NEXT:    shll $5, %eax636; X64-NEXT:    # kill: def $ax killed $ax killed $eax637; X64-NEXT:    retq638  %mul = mul nsw i16 %x, 32639  ret i16 %mul640}641 642define i16 @test_mul_by_37(i16 %x) {643; X86-LABEL: test_mul_by_37:644; X86:       # %bb.0:645; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax646; X86-NEXT:    leal (%eax,%eax,8), %ecx647; X86-NEXT:    leal (%eax,%ecx,4), %eax648; X86-NEXT:    # kill: def $ax killed $ax killed $eax649; X86-NEXT:    retl650;651; X64-LABEL: test_mul_by_37:652; X64:       # %bb.0:653; X64-NEXT:    # kill: def $edi killed $edi def $rdi654; X64-NEXT:    leal (%rdi,%rdi,8), %eax655; X64-NEXT:    leal (%rdi,%rax,4), %eax656; X64-NEXT:    # kill: def $ax killed $ax killed $eax657; X64-NEXT:    retq658  %mul = mul nsw i16 %x, 37659  ret i16 %mul660}661 662define i16 @test_mul_by_41(i16 %x) {663; X86-LABEL: test_mul_by_41:664; X86:       # %bb.0:665; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax666; X86-NEXT:    leal (%eax,%eax,4), %ecx667; X86-NEXT:    leal (%eax,%ecx,8), %eax668; X86-NEXT:    # kill: def $ax killed $ax killed $eax669; X86-NEXT:    retl670;671; X64-LABEL: test_mul_by_41:672; X64:       # %bb.0:673; X64-NEXT:    # kill: def $edi killed $edi def $rdi674; X64-NEXT:    leal (%rdi,%rdi,4), %eax675; X64-NEXT:    leal (%rdi,%rax,8), %eax676; X64-NEXT:    # kill: def $ax killed $ax killed $eax677; X64-NEXT:    retq678  %mul = mul nsw i16 %x, 41679  ret i16 %mul680}681 682define i16 @test_mul_by_62(i16 %x) {683; X86-LABEL: test_mul_by_62:684; X86:       # %bb.0:685; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax686; X86-NEXT:    leal (%eax,%eax), %ecx687; X86-NEXT:    shll $6, %eax688; X86-NEXT:    subl %ecx, %eax689; X86-NEXT:    # kill: def $ax killed $ax killed $eax690; X86-NEXT:    retl691;692; X64-LABEL: test_mul_by_62:693; X64:       # %bb.0:694; X64-NEXT:    movl %edi, %eax695; X64-NEXT:    leal (%rax,%rax), %ecx696; X64-NEXT:    shll $6, %eax697; X64-NEXT:    subl %ecx, %eax698; X64-NEXT:    # kill: def $ax killed $ax killed $rax699; X64-NEXT:    retq700  %mul = mul nsw i16 %x, 62701  ret i16 %mul702}703 704define i16 @test_mul_by_66(i16 %x) {705; X86-LABEL: test_mul_by_66:706; X86:       # %bb.0:707; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax708; X86-NEXT:    movl %eax, %ecx709; X86-NEXT:    shll $6, %ecx710; X86-NEXT:    leal (%ecx,%eax,2), %eax711; X86-NEXT:    # kill: def $ax killed $ax killed $eax712; X86-NEXT:    retl713;714; X64-LABEL: test_mul_by_66:715; X64:       # %bb.0:716; X64-NEXT:    # kill: def $edi killed $edi def $rdi717; X64-NEXT:    movl %edi, %eax718; X64-NEXT:    shll $6, %edi719; X64-NEXT:    leal (%rdi,%rax,2), %eax720; X64-NEXT:    # kill: def $ax killed $ax killed $eax721; X64-NEXT:    retq722  %mul = mul nsw i16 %x, 66723  ret i16 %mul724}725 726define i16 @test_mul_by_73(i16 %x) {727; X86-LABEL: test_mul_by_73:728; X86:       # %bb.0:729; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax730; X86-NEXT:    leal (%eax,%eax,8), %ecx731; X86-NEXT:    leal (%eax,%ecx,8), %eax732; X86-NEXT:    # kill: def $ax killed $ax killed $eax733; X86-NEXT:    retl734;735; X64-LABEL: test_mul_by_73:736; X64:       # %bb.0:737; X64-NEXT:    # kill: def $edi killed $edi def $rdi738; X64-NEXT:    leal (%rdi,%rdi,8), %eax739; X64-NEXT:    leal (%rdi,%rax,8), %eax740; X64-NEXT:    # kill: def $ax killed $ax killed $eax741; X64-NEXT:    retq742  %mul = mul nsw i16 %x, 73743  ret i16 %mul744}745 746define i16 @test_mul_by_520(i16 %x) {747; X86-LABEL: test_mul_by_520:748; X86:       # %bb.0:749; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax750; X86-NEXT:    movl %eax, %ecx751; X86-NEXT:    shll $9, %ecx752; X86-NEXT:    leal (%ecx,%eax,8), %eax753; X86-NEXT:    # kill: def $ax killed $ax killed $eax754; X86-NEXT:    retl755;756; X64-LABEL: test_mul_by_520:757; X64:       # %bb.0:758; X64-NEXT:    # kill: def $edi killed $edi def $rdi759; X64-NEXT:    movl %edi, %eax760; X64-NEXT:    shll $9, %edi761; X64-NEXT:    leal (%rdi,%rax,8), %eax762; X64-NEXT:    # kill: def $ax killed $ax killed $eax763; X64-NEXT:    retq764  %mul = mul nsw i16 %x, 520765  ret i16 %mul766}767 768define i16 @test_mul_by_neg10(i16 %x) {769; X86-LABEL: test_mul_by_neg10:770; X86:       # %bb.0:771; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax772; X86-NEXT:    addl %eax, %eax773; X86-NEXT:    leal (%eax,%eax,4), %eax774; X86-NEXT:    negl %eax775; X86-NEXT:    # kill: def $ax killed $ax killed $eax776; X86-NEXT:    retl777;778; X64-LABEL: test_mul_by_neg10:779; X64:       # %bb.0:780; X64-NEXT:    # kill: def $edi killed $edi def $rdi781; X64-NEXT:    addl %edi, %edi782; X64-NEXT:    leal (%rdi,%rdi,4), %eax783; X64-NEXT:    negl %eax784; X64-NEXT:    # kill: def $ax killed $ax killed $eax785; X64-NEXT:    retq786  %mul = mul nsw i16 %x, -10787  ret i16 %mul788}789 790define i16 @test_mul_by_neg36(i16 %x) {791; X86-LABEL: test_mul_by_neg36:792; X86:       # %bb.0:793; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax794; X86-NEXT:    shll $2, %eax795; X86-NEXT:    leal (%eax,%eax,8), %eax796; X86-NEXT:    negl %eax797; X86-NEXT:    # kill: def $ax killed $ax killed $eax798; X86-NEXT:    retl799;800; X64-LABEL: test_mul_by_neg36:801; X64:       # %bb.0:802; X64-NEXT:    # kill: def $edi killed $edi def $rdi803; X64-NEXT:    shll $2, %edi804; X64-NEXT:    leal (%rdi,%rdi,8), %eax805; X64-NEXT:    negl %eax806; X64-NEXT:    # kill: def $ax killed $ax killed $eax807; X64-NEXT:    retq808  %mul = mul nsw i16 %x, -36809  ret i16 %mul810}811 812; (x*9+42)*(x*5+2)813define i16 @test_mul_spec(i16 %x) nounwind {814; X86-LABEL: test_mul_spec:815; X86:       # %bb.0:816; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax817; X86-NEXT:    leal 42(%eax,%eax,8), %ecx818; X86-NEXT:    leal 2(%eax,%eax,4), %eax819; X86-NEXT:    imull %ecx, %eax820; X86-NEXT:    # kill: def $ax killed $ax killed $eax821; X86-NEXT:    retl822;823; X64-LABEL: test_mul_spec:824; X64:       # %bb.0:825; X64-NEXT:    # kill: def $edi killed $edi def $rdi826; X64-NEXT:    leal 42(%rdi,%rdi,8), %ecx827; X64-NEXT:    leal 2(%rdi,%rdi,4), %eax828; X64-NEXT:    imull %ecx, %eax829; X64-NEXT:    # kill: def $ax killed $ax killed $eax830; X64-NEXT:    retq831  %mul = mul nsw i16 %x, 9832  %add = add nsw i16 %mul, 42833  %mul2 = mul nsw i16 %x, 5834  %add2 = add nsw i16 %mul2, 2835  %mul3 = mul nsw i16 %add, %add2836  ret i16 %mul3837}838