brintos

brintos / llvm-project-archived public Read only

0
0
Text · 17.5 KiB · c87a383 Raw
290 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s2 3define void @and() {4  %res0 = and i8 undef, undef5  %res1 = and i16 undef, undef6  %res2 = and i32 undef, undef7  %res3 = and i64 undef, undef8  %resQ = and i128 undef, undef9  %res4 = and <2 x i8> undef, undef10  %res5 = and <2 x i16> undef, undef11  %res6 = and <2 x i32> undef, undef12  %res7 = and <2 x i64> undef, undef13  %res8 = and <4 x i8> undef, undef14  %res9 = and <4 x i16> undef, undef15  %res10 = and <4 x i32> undef, undef16  %res11 = and <4 x i64> undef, undef17  %res12 = and <8 x i8> undef, undef18  %res13 = and <8 x i16> undef, undef19  %res14 = and <8 x i32> undef, undef20  %res15 = and <8 x i64> undef, undef21  %res16 = and <16 x i8> undef, undef22  %res17 = and <16 x i16> undef, undef23  %res18 = and <16 x i32> undef, undef24  %res19 = and <16 x i64> undef, undef25 26; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = and i8 undef, undef27; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = and i16 undef, undef28; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = and i32 undef, undef29; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = and i64 undef, undef30; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = and i128 undef, undef31; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = and <2 x i8> undef, undef32; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = and <2 x i16> undef, undef33; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = and <2 x i32> undef, undef34; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = and <2 x i64> undef, undef35; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = and <4 x i8> undef, undef36; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = and <4 x i16> undef, undef37; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = and <4 x i32> undef, undef38; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = and <4 x i64> undef, undef39; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = and <8 x i8> undef, undef40; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = and <8 x i16> undef, undef41; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = and <8 x i32> undef, undef42; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = and <8 x i64> undef, undef43; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = and <16 x i8> undef, undef44; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = and <16 x i16> undef, undef45; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = and <16 x i32> undef, undef46; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = and <16 x i64> undef, undef47 48  ret void;49}50 51define void @ashr() {52  %res0 = ashr i8 undef, undef53  %res1 = ashr i16 undef, undef54  %res2 = ashr i32 undef, undef55  %res3 = ashr i64 undef, undef56  %resQ = ashr i128 undef, undef57  %res4 = ashr <2 x i8> undef, undef58  %res5 = ashr <2 x i16> undef, undef59  %res6 = ashr <2 x i32> undef, undef60  %res7 = ashr <2 x i64> undef, undef61  %res8 = ashr <4 x i8> undef, undef62  %res9 = ashr <4 x i16> undef, undef63  %res10 = ashr <4 x i32> undef, undef64  %res11 = ashr <4 x i64> undef, undef65  %res12 = ashr <8 x i8> undef, undef66  %res13 = ashr <8 x i16> undef, undef67  %res14 = ashr <8 x i32> undef, undef68  %res15 = ashr <8 x i64> undef, undef69  %res16 = ashr <16 x i8> undef, undef70  %res17 = ashr <16 x i16> undef, undef71  %res18 = ashr <16 x i32> undef, undef72  %res19 = ashr <16 x i64> undef, undef73 74; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = ashr i8 undef, undef75; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = ashr i16 undef, undef76; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = ashr i32 undef, undef77; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = ashr i64 undef, undef78; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = ashr i128 undef, undef79; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = ashr <2 x i8> undef, undef80; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = ashr <2 x i16> undef, undef81; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = ashr <2 x i32> undef, undef82; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = ashr <2 x i64> undef, undef83; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = ashr <4 x i8> undef, undef84; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = ashr <4 x i16> undef, undef85; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = ashr <4 x i32> undef, undef86; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = ashr <4 x i64> undef, undef87; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = ashr <8 x i8> undef, undef88; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = ashr <8 x i16> undef, undef89; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = ashr <8 x i32> undef, undef90; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = ashr <8 x i64> undef, undef91; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = ashr <16 x i8> undef, undef92; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = ashr <16 x i16> undef, undef93; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = ashr <16 x i32> undef, undef94; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = ashr <16 x i64> undef, undef95 96  ret void;97}98 99define void @lshr() {100  %res0 = lshr i8 undef, undef101  %res1 = lshr i16 undef, undef102  %res2 = lshr i32 undef, undef103  %res3 = lshr i64 undef, undef104  %resQ = lshr i128 undef, undef105  %res4 = lshr <2 x i8> undef, undef106  %res5 = lshr <2 x i16> undef, undef107  %res6 = lshr <2 x i32> undef, undef108  %res7 = lshr <2 x i64> undef, undef109  %res8 = lshr <4 x i8> undef, undef110  %res9 = lshr <4 x i16> undef, undef111  %res10 = lshr <4 x i32> undef, undef112  %res11 = lshr <4 x i64> undef, undef113  %res12 = lshr <8 x i8> undef, undef114  %res13 = lshr <8 x i16> undef, undef115  %res14 = lshr <8 x i32> undef, undef116  %res15 = lshr <8 x i64> undef, undef117  %res16 = lshr <16 x i8> undef, undef118  %res17 = lshr <16 x i16> undef, undef119  %res18 = lshr <16 x i32> undef, undef120  %res19 = lshr <16 x i64> undef, undef121 122; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = lshr i8 undef, undef123; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = lshr i16 undef, undef124; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = lshr i32 undef, undef125; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = lshr i64 undef, undef126; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = lshr i128 undef, undef127; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = lshr <2 x i8> undef, undef128; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = lshr <2 x i16> undef, undef129; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = lshr <2 x i32> undef, undef130; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = lshr <2 x i64> undef, undef131; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = lshr <4 x i8> undef, undef132; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = lshr <4 x i16> undef, undef133; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = lshr <4 x i32> undef, undef134; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = lshr <4 x i64> undef, undef135; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = lshr <8 x i8> undef, undef136; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = lshr <8 x i16> undef, undef137; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = lshr <8 x i32> undef, undef138; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = lshr <8 x i64> undef, undef139; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = lshr <16 x i8> undef, undef140; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = lshr <16 x i16> undef, undef141; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = lshr <16 x i32> undef, undef142; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = lshr <16 x i64> undef, undef143 144  ret void;145}146 147define void @or() {148  %res0 = or i8 undef, undef149  %res1 = or i16 undef, undef150  %res2 = or i32 undef, undef151  %res3 = or i64 undef, undef152  %resQ = or i128 undef, undef153  %res4 = or <2 x i8> undef, undef154  %res5 = or <2 x i16> undef, undef155  %res6 = or <2 x i32> undef, undef156  %res7 = or <2 x i64> undef, undef157  %res8 = or <4 x i8> undef, undef158  %res9 = or <4 x i16> undef, undef159  %res10 = or <4 x i32> undef, undef160  %res11 = or <4 x i64> undef, undef161  %res12 = or <8 x i8> undef, undef162  %res13 = or <8 x i16> undef, undef163  %res14 = or <8 x i32> undef, undef164  %res15 = or <8 x i64> undef, undef165  %res16 = or <16 x i8> undef, undef166  %res17 = or <16 x i16> undef, undef167  %res18 = or <16 x i32> undef, undef168  %res19 = or <16 x i64> undef, undef169  170; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = or i8 undef, undef171; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = or i16 undef, undef172; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = or i32 undef, undef173; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = or i64 undef, undef174; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = or i128 undef, undef175; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = or <2 x i8> undef, undef176; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = or <2 x i16> undef, undef177; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = or <2 x i32> undef, undef178; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = or <2 x i64> undef, undef179; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = or <4 x i8> undef, undef180; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = or <4 x i16> undef, undef181; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = or <4 x i32> undef, undef182; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = or <4 x i64> undef, undef183; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = or <8 x i8> undef, undef184; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = or <8 x i16> undef, undef185; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = or <8 x i32> undef, undef186; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = or <8 x i64> undef, undef187; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = or <16 x i8> undef, undef188; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = or <16 x i16> undef, undef189; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = or <16 x i32> undef, undef190; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = or <16 x i64> undef, undef191 192  ret void;193}194 195define void @shl() {196  %res0 = shl i8 undef, undef197  %res1 = shl i16 undef, undef198  %res2 = shl i32 undef, undef199  %res3 = shl i64 undef, undef200  %resQ = shl i128 undef, undef201  %res4 = shl <2 x i8> undef, undef202  %res5 = shl <2 x i16> undef, undef203  %res6 = shl <2 x i32> undef, undef204  %res7 = shl <2 x i64> undef, undef205  %res8 = shl <4 x i8> undef, undef206  %res9 = shl <4 x i16> undef, undef207  %res10 = shl <4 x i32> undef, undef208  %res11 = shl <4 x i64> undef, undef209  %res12 = shl <8 x i8> undef, undef210  %res13 = shl <8 x i16> undef, undef211  %res14 = shl <8 x i32> undef, undef212  %res15 = shl <8 x i64> undef, undef213  %res16 = shl <16 x i8> undef, undef214  %res17 = shl <16 x i16> undef, undef215  %res18 = shl <16 x i32> undef, undef216  %res19 = shl <16 x i64> undef, undef217  218; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = shl i8 undef, undef219; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = shl i16 undef, undef220; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = shl i32 undef, undef221; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = shl i64 undef, undef222; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = shl i128 undef, undef223; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = shl <2 x i8> undef, undef224; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = shl <2 x i16> undef, undef225; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = shl <2 x i32> undef, undef226; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = shl <2 x i64> undef, undef227; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = shl <4 x i8> undef, undef228; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = shl <4 x i16> undef, undef229; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = shl <4 x i32> undef, undef230; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = shl <4 x i64> undef, undef231; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = shl <8 x i8> undef, undef232; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = shl <8 x i16> undef, undef233; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = shl <8 x i32> undef, undef234; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = shl <8 x i64> undef, undef235; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = shl <16 x i8> undef, undef236; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = shl <16 x i16> undef, undef237; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = shl <16 x i32> undef, undef238; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = shl <16 x i64> undef, undef239 240  ret void;241}242 243define void @xor() {244  %res0 = xor i8 undef, undef245  %res1 = xor i16 undef, undef246  %res2 = xor i32 undef, undef247  %res3 = xor i64 undef, undef248  %resQ = xor i128 undef, undef249  %res4 = xor <2 x i8> undef, undef250  %res5 = xor <2 x i16> undef, undef251  %res6 = xor <2 x i32> undef, undef252  %res7 = xor <2 x i64> undef, undef253  %res8 = xor <4 x i8> undef, undef254  %res9 = xor <4 x i16> undef, undef255  %res10 = xor <4 x i32> undef, undef256  %res11 = xor <4 x i64> undef, undef257  %res12 = xor <8 x i8> undef, undef258  %res13 = xor <8 x i16> undef, undef259  %res14 = xor <8 x i32> undef, undef260  %res15 = xor <8 x i64> undef, undef261  %res16 = xor <16 x i8> undef, undef262  %res17 = xor <16 x i16> undef, undef263  %res18 = xor <16 x i32> undef, undef264  %res19 = xor <16 x i64> undef, undef265  266; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = xor i8 undef, undef267; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = xor i16 undef, undef268; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = xor i32 undef, undef269; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = xor i64 undef, undef270; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %resQ = xor i128 undef, undef271; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = xor <2 x i8> undef, undef272; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = xor <2 x i16> undef, undef273; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = xor <2 x i32> undef, undef274; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = xor <2 x i64> undef, undef275; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = xor <4 x i8> undef, undef276; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = xor <4 x i16> undef, undef277; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = xor <4 x i32> undef, undef278; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = xor <4 x i64> undef, undef279; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = xor <8 x i8> undef, undef280; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = xor <8 x i16> undef, undef281; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = xor <8 x i32> undef, undef282; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = xor <8 x i64> undef, undef283; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = xor <16 x i8> undef, undef284; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = xor <16 x i16> undef, undef285; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = xor <16 x i32> undef, undef286; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = xor <16 x i64> undef, undef287 288  ret void;289}290