Lines Matching full:cost
91 PreciseRotationCost("precise-rotation-cost",
92 cl::desc("Model the cost of loop rotation more "
97 "misfetch-cost",
98 cl::desc("Cost that models the probablistic risk of an instruction "
99 "misfetch due to a jump comparing to falling through, whose cost "
103 static cl::opt<unsigned> JumpInstCost("jump-inst-cost",
104 cl::desc("Cost of jump instructions."),
519 // FIXME: If this shows up on profiles, it could be folded (at the cost of
841 /// \brief Attempt to rotate a loop based on profile data to reduce branch cost.
843 /// With profile data, we can determine the cost in terms of missed fall through
845 /// Basically, there are three kinds of cost to consider for each rotation:
852 /// Therefore, the cost for a given rotation is the sum of costs listed above.
853 /// We select the best rotation with the smallest cost.
873 // Compute the cost of the missed fall-through edge to the loop header if the
885 // need to consider the cost of this jump.
893 // its hottest exit edge. For each loop rotation, we define the loop exit cost
914 // cost assuming the block is the head of the loop chain. When the loop ends,
926 // Calculate the cost by putting this BB to the top.
927 BlockFrequency Cost = 0;
930 // cost of the missed fall through edge from outside of the loop to the
933 Cost += HeaderFallThroughCost;
935 // Collect the loop exit cost by summing up frequencies of all exit edges
939 Cost += ExitWithFreq.second;
941 // The cost of breaking the once fall-through edge from the tail to the top
944 // additional jmp instruction. So the cost here is (MisfetchCost +
951 // of the edge to the chain head, then the cost will be
954 // we won't consider any additional cost.
958 Cost += ScaleBlockFrequency(TailBBFreq.getFrequency(),
966 Cost += ScaleBlockFrequency(TailToHeadFreq, MisfetchCost) +
971 DEBUG(dbgs() << "The cost of loop rotation by making " << getBlockNum(*Iter)
972 << " to the top: " << Cost.getFrequency() << "\n");
974 if (Cost < SmallestRotationCost) {
975 SmallestRotationCost = Cost;