brintos

brintos / llvm-project-archived public Read only

0
0
Text · 18.4 KiB · e2e560e Raw
628 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s3 4; https://bugs.llvm.org/show_bug.cgi?id=371045 6define i8 @out8(i8 %x, i8 %y, i8 %mask) {7; CHECK-LABEL: out8:8; CHECK:       // %bb.0:9; CHECK-NEXT:    and w8, w0, w210; CHECK-NEXT:    bic w9, w1, w211; CHECK-NEXT:    orr w0, w8, w912; CHECK-NEXT:    ret13  %mx = and i8 %x, %mask14  %notmask = xor i8 %mask, -115  %my = and i8 %y, %notmask16  %r = or i8 %mx, %my17  ret i8 %r18}19 20define i16 @out16(i16 %x, i16 %y, i16 %mask) {21; CHECK-LABEL: out16:22; CHECK:       // %bb.0:23; CHECK-NEXT:    and w8, w0, w224; CHECK-NEXT:    bic w9, w1, w225; CHECK-NEXT:    orr w0, w8, w926; CHECK-NEXT:    ret27  %mx = and i16 %x, %mask28  %notmask = xor i16 %mask, -129  %my = and i16 %y, %notmask30  %r = or i16 %mx, %my31  ret i16 %r32}33 34define i32 @out32(i32 %x, i32 %y, i32 %mask) {35; CHECK-LABEL: out32:36; CHECK:       // %bb.0:37; CHECK-NEXT:    and w8, w0, w238; CHECK-NEXT:    bic w9, w1, w239; CHECK-NEXT:    orr w0, w8, w940; CHECK-NEXT:    ret41  %mx = and i32 %x, %mask42  %notmask = xor i32 %mask, -143  %my = and i32 %y, %notmask44  %r = or i32 %mx, %my45  ret i32 %r46}47 48define i64 @out64(i64 %x, i64 %y, i64 %mask) {49; CHECK-LABEL: out64:50; CHECK:       // %bb.0:51; CHECK-NEXT:    and x8, x0, x252; CHECK-NEXT:    bic x9, x1, x253; CHECK-NEXT:    orr x0, x8, x954; CHECK-NEXT:    ret55  %mx = and i64 %x, %mask56  %notmask = xor i64 %mask, -157  %my = and i64 %y, %notmask58  %r = or i64 %mx, %my59  ret i64 %r60}61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62; Should be the same as the previous one.63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64 65define i8 @in8(i8 %x, i8 %y, i8 %mask) {66; CHECK-LABEL: in8:67; CHECK:       // %bb.0:68; CHECK-NEXT:    bic w8, w1, w269; CHECK-NEXT:    and w9, w0, w270; CHECK-NEXT:    orr w0, w9, w871; CHECK-NEXT:    ret72  %n0 = xor i8 %x, %y73  %n1 = and i8 %n0, %mask74  %r = xor i8 %n1, %y75  ret i8 %r76}77 78define i16 @in16(i16 %x, i16 %y, i16 %mask) {79; CHECK-LABEL: in16:80; CHECK:       // %bb.0:81; CHECK-NEXT:    bic w8, w1, w282; CHECK-NEXT:    and w9, w0, w283; CHECK-NEXT:    orr w0, w9, w884; CHECK-NEXT:    ret85  %n0 = xor i16 %x, %y86  %n1 = and i16 %n0, %mask87  %r = xor i16 %n1, %y88  ret i16 %r89}90 91define i32 @in32(i32 %x, i32 %y, i32 %mask) {92; CHECK-LABEL: in32:93; CHECK:       // %bb.0:94; CHECK-NEXT:    bic w8, w1, w295; CHECK-NEXT:    and w9, w0, w296; CHECK-NEXT:    orr w0, w9, w897; CHECK-NEXT:    ret98  %n0 = xor i32 %x, %y99  %n1 = and i32 %n0, %mask100  %r = xor i32 %n1, %y101  ret i32 %r102}103 104define i64 @in64(i64 %x, i64 %y, i64 %mask) {105; CHECK-LABEL: in64:106; CHECK:       // %bb.0:107; CHECK-NEXT:    bic x8, x1, x2108; CHECK-NEXT:    and x9, x0, x2109; CHECK-NEXT:    orr x0, x9, x8110; CHECK-NEXT:    ret111  %n0 = xor i64 %x, %y112  %n1 = and i64 %n0, %mask113  %r = xor i64 %n1, %y114  ret i64 %r115}116; ============================================================================ ;117; Commutativity tests.118; ============================================================================ ;119define i32 @in_commutativity_0_0_1(i32 %x, i32 %y, i32 %mask) {120; CHECK-LABEL: in_commutativity_0_0_1:121; CHECK:       // %bb.0:122; CHECK-NEXT:    bic w8, w1, w2123; CHECK-NEXT:    and w9, w0, w2124; CHECK-NEXT:    orr w0, w9, w8125; CHECK-NEXT:    ret126  %n0 = xor i32 %x, %y127  %n1 = and i32 %mask, %n0 ; swapped128  %r = xor i32 %n1, %y129  ret i32 %r130}131define i32 @in_commutativity_0_1_0(i32 %x, i32 %y, i32 %mask) {132; CHECK-LABEL: in_commutativity_0_1_0:133; CHECK:       // %bb.0:134; CHECK-NEXT:    bic w8, w1, w2135; CHECK-NEXT:    and w9, w0, w2136; CHECK-NEXT:    orr w0, w9, w8137; CHECK-NEXT:    ret138  %n0 = xor i32 %x, %y139  %n1 = and i32 %n0, %mask140  %r = xor i32 %y, %n1 ; swapped141  ret i32 %r142}143define i32 @in_commutativity_0_1_1(i32 %x, i32 %y, i32 %mask) {144; CHECK-LABEL: in_commutativity_0_1_1:145; CHECK:       // %bb.0:146; CHECK-NEXT:    bic w8, w1, w2147; CHECK-NEXT:    and w9, w0, w2148; CHECK-NEXT:    orr w0, w9, w8149; CHECK-NEXT:    ret150  %n0 = xor i32 %x, %y151  %n1 = and i32 %mask, %n0 ; swapped152  %r = xor i32 %y, %n1 ; swapped153  ret i32 %r154}155define i32 @in_commutativity_1_0_0(i32 %x, i32 %y, i32 %mask) {156; CHECK-LABEL: in_commutativity_1_0_0:157; CHECK:       // %bb.0:158; CHECK-NEXT:    bic w8, w0, w2159; CHECK-NEXT:    and w9, w1, w2160; CHECK-NEXT:    orr w0, w9, w8161; CHECK-NEXT:    ret162  %n0 = xor i32 %x, %y163  %n1 = and i32 %n0, %mask164  %r = xor i32 %n1, %x ; %x instead of %y165  ret i32 %r166}167define i32 @in_commutativity_1_0_1(i32 %x, i32 %y, i32 %mask) {168; CHECK-LABEL: in_commutativity_1_0_1:169; CHECK:       // %bb.0:170; CHECK-NEXT:    bic w8, w0, w2171; CHECK-NEXT:    and w9, w1, w2172; CHECK-NEXT:    orr w0, w9, w8173; CHECK-NEXT:    ret174  %n0 = xor i32 %x, %y175  %n1 = and i32 %mask, %n0 ; swapped176  %r = xor i32 %n1, %x ; %x instead of %y177  ret i32 %r178}179define i32 @in_commutativity_1_1_0(i32 %x, i32 %y, i32 %mask) {180; CHECK-LABEL: in_commutativity_1_1_0:181; CHECK:       // %bb.0:182; CHECK-NEXT:    bic w8, w0, w2183; CHECK-NEXT:    and w9, w1, w2184; CHECK-NEXT:    orr w0, w9, w8185; CHECK-NEXT:    ret186  %n0 = xor i32 %x, %y187  %n1 = and i32 %n0, %mask188  %r = xor i32 %x, %n1 ; swapped, %x instead of %y189  ret i32 %r190}191define i32 @in_commutativity_1_1_1(i32 %x, i32 %y, i32 %mask) {192; CHECK-LABEL: in_commutativity_1_1_1:193; CHECK:       // %bb.0:194; CHECK-NEXT:    bic w8, w0, w2195; CHECK-NEXT:    and w9, w1, w2196; CHECK-NEXT:    orr w0, w9, w8197; CHECK-NEXT:    ret198  %n0 = xor i32 %x, %y199  %n1 = and i32 %mask, %n0 ; swapped200  %r = xor i32 %x, %n1 ; swapped, %x instead of %y201  ret i32 %r202}203; ============================================================================ ;204; Y is an 'and' too.205; ============================================================================ ;206define i32 @in_complex_y0(i32 %x, i32 %y_hi, i32 %y_low, i32 %mask) {207; CHECK-LABEL: in_complex_y0:208; CHECK:       // %bb.0:209; CHECK-NEXT:    and w8, w1, w2210; CHECK-NEXT:    and w9, w0, w3211; CHECK-NEXT:    bic w8, w8, w3212; CHECK-NEXT:    orr w0, w9, w8213; CHECK-NEXT:    ret214  %y = and i32 %y_hi, %y_low215  %n0 = xor i32 %x, %y216  %n1 = and i32 %n0, %mask217  %r = xor i32 %n1, %y218  ret i32 %r219}220define i32 @in_complex_y1(i32 %x, i32 %y_hi, i32 %y_low, i32 %mask) {221; CHECK-LABEL: in_complex_y1:222; CHECK:       // %bb.0:223; CHECK-NEXT:    and w8, w1, w2224; CHECK-NEXT:    and w9, w0, w3225; CHECK-NEXT:    bic w8, w8, w3226; CHECK-NEXT:    orr w0, w9, w8227; CHECK-NEXT:    ret228  %y = and i32 %y_hi, %y_low229  %n0 = xor i32 %x, %y230  %n1 = and i32 %n0, %mask231  %r = xor i32 %y, %n1232  ret i32 %r233}234; ============================================================================ ;235; M is an 'xor' too.236; ============================================================================ ;237define i32 @in_complex_m0(i32 %x, i32 %y, i32 %m_a, i32 %m_b) {238; CHECK-LABEL: in_complex_m0:239; CHECK:       // %bb.0:240; CHECK-NEXT:    eor w8, w2, w3241; CHECK-NEXT:    bic w9, w1, w8242; CHECK-NEXT:    and w8, w0, w8243; CHECK-NEXT:    orr w0, w8, w9244; CHECK-NEXT:    ret245  %mask = xor i32 %m_a, %m_b246  %n0 = xor i32 %x, %y247  %n1 = and i32 %n0, %mask248  %r = xor i32 %n1, %y249  ret i32 %r250}251define i32 @in_complex_m1(i32 %x, i32 %y, i32 %m_a, i32 %m_b) {252; CHECK-LABEL: in_complex_m1:253; CHECK:       // %bb.0:254; CHECK-NEXT:    eor w8, w2, w3255; CHECK-NEXT:    bic w9, w1, w8256; CHECK-NEXT:    and w8, w0, w8257; CHECK-NEXT:    orr w0, w8, w9258; CHECK-NEXT:    ret259  %mask = xor i32 %m_a, %m_b260  %n0 = xor i32 %x, %y261  %n1 = and i32 %mask, %n0262  %r = xor i32 %n1, %y263  ret i32 %r264}265; ============================================================================ ;266; Both Y and M are complex.267; ============================================================================ ;268define i32 @in_complex_y0_m0(i32 %x, i32 %y_hi, i32 %y_low, i32 %m_a, i32 %m_b) {269; CHECK-LABEL: in_complex_y0_m0:270; CHECK:       // %bb.0:271; CHECK-NEXT:    eor w8, w3, w4272; CHECK-NEXT:    and w9, w1, w2273; CHECK-NEXT:    bic w9, w9, w8274; CHECK-NEXT:    and w8, w0, w8275; CHECK-NEXT:    orr w0, w8, w9276; CHECK-NEXT:    ret277  %y = and i32 %y_hi, %y_low278  %mask = xor i32 %m_a, %m_b279  %n0 = xor i32 %x, %y280  %n1 = and i32 %n0, %mask281  %r = xor i32 %n1, %y282  ret i32 %r283}284define i32 @in_complex_y1_m0(i32 %x, i32 %y_hi, i32 %y_low, i32 %m_a, i32 %m_b) {285; CHECK-LABEL: in_complex_y1_m0:286; CHECK:       // %bb.0:287; CHECK-NEXT:    eor w8, w3, w4288; CHECK-NEXT:    and w9, w1, w2289; CHECK-NEXT:    bic w9, w9, w8290; CHECK-NEXT:    and w8, w0, w8291; CHECK-NEXT:    orr w0, w8, w9292; CHECK-NEXT:    ret293  %y = and i32 %y_hi, %y_low294  %mask = xor i32 %m_a, %m_b295  %n0 = xor i32 %x, %y296  %n1 = and i32 %n0, %mask297  %r = xor i32 %y, %n1298  ret i32 %r299}300define i32 @in_complex_y0_m1(i32 %x, i32 %y_hi, i32 %y_low, i32 %m_a, i32 %m_b) {301; CHECK-LABEL: in_complex_y0_m1:302; CHECK:       // %bb.0:303; CHECK-NEXT:    eor w8, w3, w4304; CHECK-NEXT:    and w9, w1, w2305; CHECK-NEXT:    bic w9, w9, w8306; CHECK-NEXT:    and w8, w0, w8307; CHECK-NEXT:    orr w0, w8, w9308; CHECK-NEXT:    ret309  %y = and i32 %y_hi, %y_low310  %mask = xor i32 %m_a, %m_b311  %n0 = xor i32 %x, %y312  %n1 = and i32 %mask, %n0313  %r = xor i32 %n1, %y314  ret i32 %r315}316define i32 @in_complex_y1_m1(i32 %x, i32 %y_hi, i32 %y_low, i32 %m_a, i32 %m_b) {317; CHECK-LABEL: in_complex_y1_m1:318; CHECK:       // %bb.0:319; CHECK-NEXT:    eor w8, w3, w4320; CHECK-NEXT:    and w9, w1, w2321; CHECK-NEXT:    bic w9, w9, w8322; CHECK-NEXT:    and w8, w0, w8323; CHECK-NEXT:    orr w0, w8, w9324; CHECK-NEXT:    ret325  %y = and i32 %y_hi, %y_low326  %mask = xor i32 %m_a, %m_b327  %n0 = xor i32 %x, %y328  %n1 = and i32 %mask, %n0329  %r = xor i32 %y, %n1330  ret i32 %r331}332; ============================================================================ ;333; Various cases with %x and/or %y being a constant334; ============================================================================ ;335define i32 @out_constant_varx_mone(i32 %x, i32 %y, i32 %mask) {336; CHECK-LABEL: out_constant_varx_mone:337; CHECK:       // %bb.0:338; CHECK-NEXT:    and w8, w2, w0339; CHECK-NEXT:    orn w0, w8, w2340; CHECK-NEXT:    ret341  %notmask = xor i32 %mask, -1342  %mx = and i32 %mask, %x343  %my = and i32 %notmask, -1344  %r = or i32 %mx, %my345  ret i32 %r346}347define i32 @in_constant_varx_mone(i32 %x, i32 %y, i32 %mask) {348; CHECK-LABEL: in_constant_varx_mone:349; CHECK:       // %bb.0:350; CHECK-NEXT:    bic w8, w2, w0351; CHECK-NEXT:    mvn w0, w8352; CHECK-NEXT:    ret353  %n0 = xor i32 %x, -1 ; %x354  %n1 = and i32 %n0, %mask355  %r = xor i32 %n1, -1356  ret i32 %r357}358; This is not a canonical form. Testing for completeness only.359define i32 @out_constant_varx_mone_invmask(i32 %x, i32 %y, i32 %mask) {360; CHECK-LABEL: out_constant_varx_mone_invmask:361; CHECK:       // %bb.0:362; CHECK-NEXT:    orr w0, w0, w2363; CHECK-NEXT:    ret364  %notmask = xor i32 %mask, -1365  %mx = and i32 %notmask, %x366  %my = and i32 %mask, -1367  %r = or i32 %mx, %my368  ret i32 %r369}370; This is not a canonical form. Testing for completeness only.371define i32 @in_constant_varx_mone_invmask(i32 %x, i32 %y, i32 %mask) {372; CHECK-LABEL: in_constant_varx_mone_invmask:373; CHECK:       // %bb.0:374; CHECK-NEXT:    mvn w8, w0375; CHECK-NEXT:    bic w8, w8, w2376; CHECK-NEXT:    mvn w0, w8377; CHECK-NEXT:    ret378  %notmask = xor i32 %mask, -1379  %n0 = xor i32 %x, -1 ; %x380  %n1 = and i32 %n0, %notmask381  %r = xor i32 %n1, -1382  ret i32 %r383}384define i32 @out_constant_varx_42(i32 %x, i32 %y, i32 %mask) {385; CHECK-LABEL: out_constant_varx_42:386; CHECK:       // %bb.0:387; CHECK-NEXT:    mov w8, #42 // =0x2a388; CHECK-NEXT:    and w9, w2, w0389; CHECK-NEXT:    bic w8, w8, w2390; CHECK-NEXT:    orr w0, w9, w8391; CHECK-NEXT:    ret392  %notmask = xor i32 %mask, -1393  %mx = and i32 %mask, %x394  %my = and i32 %notmask, 42395  %r = or i32 %mx, %my396  ret i32 %r397}398define i32 @in_constant_varx_42(i32 %x, i32 %y, i32 %mask) {399; CHECK-LABEL: in_constant_varx_42:400; CHECK:       // %bb.0:401; CHECK-NEXT:    mov w8, #42 // =0x2a402; CHECK-NEXT:    and w9, w0, w2403; CHECK-NEXT:    bic w8, w8, w2404; CHECK-NEXT:    orr w0, w9, w8405; CHECK-NEXT:    ret406  %n0 = xor i32 %x, 42 ; %x407  %n1 = and i32 %n0, %mask408  %r = xor i32 %n1, 42409  ret i32 %r410}411; This is not a canonical form. Testing for completeness only.412define i32 @out_constant_varx_42_invmask(i32 %x, i32 %y, i32 %mask) {413; CHECK-LABEL: out_constant_varx_42_invmask:414; CHECK:       // %bb.0:415; CHECK-NEXT:    mov w8, #42 // =0x2a416; CHECK-NEXT:    bic w9, w0, w2417; CHECK-NEXT:    and w8, w2, w8418; CHECK-NEXT:    orr w0, w9, w8419; CHECK-NEXT:    ret420  %notmask = xor i32 %mask, -1421  %mx = and i32 %notmask, %x422  %my = and i32 %mask, 42423  %r = or i32 %mx, %my424  ret i32 %r425}426; This is not a canonical form. Testing for completeness only.427define i32 @in_constant_varx_42_invmask(i32 %x, i32 %y, i32 %mask) {428; CHECK-LABEL: in_constant_varx_42_invmask:429; CHECK:       // %bb.0:430; CHECK-NEXT:    mov w8, #42 // =0x2a431; CHECK-NEXT:    bic w9, w0, w2432; CHECK-NEXT:    and w8, w2, w8433; CHECK-NEXT:    orr w0, w9, w8434; CHECK-NEXT:    ret435  %notmask = xor i32 %mask, -1436  %n0 = xor i32 %x, 42 ; %x437  %n1 = and i32 %n0, %notmask438  %r = xor i32 %n1, 42439  ret i32 %r440}441define i32 @out_constant_mone_vary(i32 %x, i32 %y, i32 %mask) {442; CHECK-LABEL: out_constant_mone_vary:443; CHECK:       // %bb.0:444; CHECK-NEXT:    orr w0, w1, w2445; CHECK-NEXT:    ret446  %notmask = xor i32 %mask, -1447  %mx = and i32 %mask, -1448  %my = and i32 %notmask, %y449  %r = or i32 %mx, %my450  ret i32 %r451}452define i32 @in_constant_mone_vary(i32 %x, i32 %y, i32 %mask) {453; CHECK-LABEL: in_constant_mone_vary:454; CHECK:       // %bb.0:455; CHECK-NEXT:    orr w0, w2, w1456; CHECK-NEXT:    ret457  %n0 = xor i32 -1, %y ; %x458  %n1 = and i32 %n0, %mask459  %r = xor i32 %n1, %y460  ret i32 %r461}462; This is not a canonical form. Testing for completeness only.463define i32 @out_constant_mone_vary_invmask(i32 %x, i32 %y, i32 %mask) {464; CHECK-LABEL: out_constant_mone_vary_invmask:465; CHECK:       // %bb.0:466; CHECK-NEXT:    and w8, w2, w1467; CHECK-NEXT:    orn w0, w8, w2468; CHECK-NEXT:    ret469  %notmask = xor i32 %mask, -1470  %mx = and i32 %notmask, -1471  %my = and i32 %mask, %y472  %r = or i32 %mx, %my473  ret i32 %r474}475; This is not a canonical form. Testing for completeness only.476define i32 @in_constant_mone_vary_invmask(i32 %x, i32 %y, i32 %mask) {477; CHECK-LABEL: in_constant_mone_vary_invmask:478; CHECK:       // %bb.0:479; CHECK-NEXT:    orn w0, w1, w2480; CHECK-NEXT:    ret481  %notmask = xor i32 %mask, -1482  %n0 = xor i32 -1, %y ; %x483  %n1 = and i32 %n0, %notmask484  %r = xor i32 %n1, %y485  ret i32 %r486}487define i32 @out_constant_42_vary(i32 %x, i32 %y, i32 %mask) {488; CHECK-LABEL: out_constant_42_vary:489; CHECK:       // %bb.0:490; CHECK-NEXT:    mov w8, #42 // =0x2a491; CHECK-NEXT:    bic w9, w1, w2492; CHECK-NEXT:    and w8, w2, w8493; CHECK-NEXT:    orr w0, w8, w9494; CHECK-NEXT:    ret495  %notmask = xor i32 %mask, -1496  %mx = and i32 %mask, 42497  %my = and i32 %notmask, %y498  %r = or i32 %mx, %my499  ret i32 %r500}501define i32 @in_constant_42_vary(i32 %x, i32 %y, i32 %mask) {502; CHECK-LABEL: in_constant_42_vary:503; CHECK:       // %bb.0:504; CHECK-NEXT:    mov w8, #42 // =0x2a505; CHECK-NEXT:    bic w9, w1, w2506; CHECK-NEXT:    and w8, w2, w8507; CHECK-NEXT:    orr w0, w8, w9508; CHECK-NEXT:    ret509  %n0 = xor i32 42, %y ; %x510  %n1 = and i32 %n0, %mask511  %r = xor i32 %n1, %y512  ret i32 %r513}514; This is not a canonical form. Testing for completeness only.515define i32 @out_constant_42_vary_invmask(i32 %x, i32 %y, i32 %mask) {516; CHECK-LABEL: out_constant_42_vary_invmask:517; CHECK:       // %bb.0:518; CHECK-NEXT:    mov w8, #42 // =0x2a519; CHECK-NEXT:    and w9, w2, w1520; CHECK-NEXT:    bic w8, w8, w2521; CHECK-NEXT:    orr w0, w8, w9522; CHECK-NEXT:    ret523  %notmask = xor i32 %mask, -1524  %mx = and i32 %notmask, 42525  %my = and i32 %mask, %y526  %r = or i32 %mx, %my527  ret i32 %r528}529; This is not a canonical form. Testing for completeness only.530define i32 @in_constant_42_vary_invmask(i32 %x, i32 %y, i32 %mask) {531; CHECK-LABEL: in_constant_42_vary_invmask:532; CHECK:       // %bb.0:533; CHECK-NEXT:    mov w8, #42 // =0x2a534; CHECK-NEXT:    and w9, w1, w2535; CHECK-NEXT:    bic w8, w8, w2536; CHECK-NEXT:    orr w0, w8, w9537; CHECK-NEXT:    ret538  %notmask = xor i32 %mask, -1539  %n0 = xor i32 42, %y ; %x540  %n1 = and i32 %n0, %notmask541  %r = xor i32 %n1, %y542  ret i32 %r543}544; ============================================================================ ;545; Negative tests. Should not be folded.546; ============================================================================ ;547; Multi-use tests.548declare void @use32(i32) nounwind549define i32 @in_multiuse_A(i32 %x, i32 %y, i32 %z, i32 %mask) nounwind {550; CHECK-LABEL: in_multiuse_A:551; CHECK:       // %bb.0:552; CHECK-NEXT:    str x30, [sp, #-32]! // 8-byte Folded Spill553; CHECK-NEXT:    eor w8, w0, w1554; CHECK-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill555; CHECK-NEXT:    mov w19, w1556; CHECK-NEXT:    and w20, w8, w3557; CHECK-NEXT:    mov w0, w20558; CHECK-NEXT:    bl use32559; CHECK-NEXT:    eor w0, w20, w19560; CHECK-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload561; CHECK-NEXT:    ldr x30, [sp], #32 // 8-byte Folded Reload562; CHECK-NEXT:    ret563  %n0 = xor i32 %x, %y564  %n1 = and i32 %n0, %mask565  call void @use32(i32 %n1)566  %r = xor i32 %n1, %y567  ret i32 %r568}569define i32 @in_multiuse_B(i32 %x, i32 %y, i32 %z, i32 %mask) nounwind {570; CHECK-LABEL: in_multiuse_B:571; CHECK:       // %bb.0:572; CHECK-NEXT:    str x30, [sp, #-32]! // 8-byte Folded Spill573; CHECK-NEXT:    eor w0, w0, w1574; CHECK-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill575; CHECK-NEXT:    mov w19, w1576; CHECK-NEXT:    and w20, w0, w3577; CHECK-NEXT:    bl use32578; CHECK-NEXT:    eor w0, w20, w19579; CHECK-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload580; CHECK-NEXT:    ldr x30, [sp], #32 // 8-byte Folded Reload581; CHECK-NEXT:    ret582  %n0 = xor i32 %x, %y583  %n1 = and i32 %n0, %mask584  call void @use32(i32 %n0)585  %r = xor i32 %n1, %y586  ret i32 %r587}588; Various bad variants589define i32 @n0_badmask(i32 %x, i32 %y, i32 %mask, i32 %mask2) {590; CHECK-LABEL: n0_badmask:591; CHECK:       // %bb.0:592; CHECK-NEXT:    bic w8, w1, w3593; CHECK-NEXT:    and w9, w0, w2594; CHECK-NEXT:    orr w0, w9, w8595; CHECK-NEXT:    ret596  %mx = and i32 %x, %mask597  %notmask = xor i32 %mask2, -1 ; %mask2 instead of %mask598  %my = and i32 %y, %notmask599  %r = or i32 %mx, %my600  ret i32 %r601}602define i32 @n0_badxor(i32 %x, i32 %y, i32 %mask) {603; CHECK-LABEL: n0_badxor:604; CHECK:       // %bb.0:605; CHECK-NEXT:    eor w8, w2, #0x1606; CHECK-NEXT:    and w9, w0, w2607; CHECK-NEXT:    and w8, w1, w8608; CHECK-NEXT:    orr w0, w9, w8609; CHECK-NEXT:    ret610  %mx = and i32 %x, %mask611  %notmask = xor i32 %mask, 1 ; instead of -1612  %my = and i32 %y, %notmask613  %r = or i32 %mx, %my614  ret i32 %r615}616define i32 @n1_thirdvar(i32 %x, i32 %y, i32 %z, i32 %mask) {617; CHECK-LABEL: n1_thirdvar:618; CHECK:       // %bb.0:619; CHECK-NEXT:    eor w8, w0, w1620; CHECK-NEXT:    and w8, w8, w3621; CHECK-NEXT:    eor w0, w8, w2622; CHECK-NEXT:    ret623  %n0 = xor i32 %x, %y624  %n1 = and i32 %n0, %mask625  %r = xor i32 %n1, %z ; instead of %y626  ret i32 %r627}628