Lines Matching refs:cost
88 unsigned Cost; // Number of instrs used to generate this value.
92 ShuffleVal() : Cost(1000000) {}
108 unsigned Cost;
111 unsigned cost = 1)
112 : ShuffleMask(shufflemask), OpNum(opnum), Name(name), Cost(cost) {
125 unsigned getCost() const { return Cost; }
153 assert(0 && "bad zero cost operation");
164 if (ShufTab[ShufTab[ThisOp].Arg0].Cost == 0) {
178 if (ShufTab[ShufTab[ThisOp].Arg1].Cost == 0) {
196 Count += ShufTab[i].Cost < 100;
202 if (ShufTab[Elt].Cost == 0) return;
210 if (ShufTab[Arg0].Cost)
212 if (Arg0 != Arg1 && ShufTab[Arg1].Cost)
221 ShufTab[0x0123].Cost = 0;
224 ShufTab[0x4567].Cost = 0;
238 // Scan the table for two reasons: First, compute the maximum cost of any
241 unsigned MaxCost = ShufTab[0].Cost;
244 if (ShufTab[i].Cost > MaxCost)
245 MaxCost = ShufTab[i].Cost;
251 // permutation, like 7u4u. To compute the lowest cost for 7u4u, we
252 // need to take the minimum cost of all of 7[0-8]4[0-8], 81 entries. If
275 unsigned MinCost = ShufTab[i].Cost;
280 if (ShufTab[NewElt].Cost < MinCost) {
281 MinCost = ShufTab[NewElt].Cost;
296 if (ShufTab[LHS].Cost > 1000) continue;
300 if (ShufTab[LHS].Cost + 1 >= MaxCost)
309 unsigned Cost = ShufTab[LHS].Cost + Op->getCost();
310 if (Cost < ShufTab[ResultMask].Cost) {
311 ShufTab[ResultMask].Cost = Cost;
324 if (ShufTab[RHS].Cost > 1000) continue;
328 if (ShufTab[RHS].Cost + 1 >= MaxCost)
335 if (ShufTab[ResultMask].Cost <= OpCount ||
336 ShufTab[ResultMask].Cost <= ShufTab[LHS].Cost ||
337 ShufTab[ResultMask].Cost <= ShufTab[RHS].Cost)
340 // Figure out the cost to evaluate this, knowing that CSE's only need
347 unsigned Cost = NumVals + Op->getCost();
348 if (Cost < ShufTab[ResultMask].Cost) {
349 ShufTab[ResultMask].Cost = Cost;
365 // Compute a cost histogram.
368 if (ShufTab[i].Cost > 9)
371 ++CostArray[ShufTab[i].Cost];
376 std::cout << "// " << CostArray[i] << " entries have cost " << i << "\n";
378 std::cout << "// " << CostArray[9] << " entries have higher cost!\n";
388 // CostSat - The cost of this operation saturated to two bits.
389 unsigned CostSat = ShufTab[i].Cost;
392 --CostSat; // Cost is now between 0-3.
400 // Encode this as 2 bits of saturated cost, 4 bits of opcodes, 13 bits of
406 std::cout << ": Cost " << ShufTab[i].Cost;
409 if (ShufTab[ShufTab[i].Arg0].Cost == 0) {
417 if (ShufTab[ShufTab[i].Arg1].Cost == 0) {
431 if (ShufTab[i].Cost < 1000) {
433 std::cerr << " - Cost " << ShufTab[i].Cost << " - ";