Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Weight

87 //          |   | (Weight = 124)
91 // | (Weight = 4)
126 /// Special weight used for cases with exact zero probability.
128 /// Minimal possible non zero weight.
130 /// Weight to an 'unreachable' block.
132 /// Weight to a block containing non returning call.
134 /// Weight to 'unwind' block of an invoke instruction.
136 /// Weight to a 'cold' block. Cold blocks are the ones containing calls marked
139 /// Default weight is used in cases when there is no dedicated execution
140 /// weight set. It is not propagated through the domination line either.
321 // operand to the metadata node is a name, not a weight.
334 ConstantInt *Weight =
336 if (!Weight)
338 assert(Weight->getValue().getActiveBits() <= 32 &&
340 Weights.push_back(Weight->getZExtValue());
354 // If the sum of weights does not fit in 32 bits, scale every weight down
612 // For edges entering a loop take weight of a loop rather than an individual
626 auto Weight = getEstimatedEdgeWeight({SrcLoopBB, DstLoopBB});
628 if (!Weight)
631 if (!MaxWeight || MaxWeight.getValue() < Weight.getValue())
632 MaxWeight = Weight;
638 // Updates \p LoopBB's weight and returns true. If \p LoopBB has already
639 // an associated weight it is unchanged and false is returned.
641 // Please note by the algorithm the weight is not expected to change once set
649 // In general, weight is assigned to a block when it has final value and
653 // set weight is favored and all consequent weights are ignored.
680 // successor has updated estimated weight.
689 // TODO: Consider propagating weight down the domination line as well.
701 // Don't propagate weight to blocks belonging to different loops.
705 // If DomBB has weight set then all it's predecessors are already
706 // processed (since we propagate weight up to the top of IR each time).
726 // Important note regarding the order of checks. They are ordered by weight
757 // best to propagate the weight to up/down the IR.
768 // If we were able to find estimated weight for the block set it to this
775 // successor/exit having estimated weight. Try to propagate weight to such
809 // weight of "hot" path. In theory we can probably find a better function
824 // Calculate edge probabilities based on block's estimated weight.
838 // Changed to 'true' if at least one successor has estimated weight.
844 Optional<uint32_t> Weight;
848 Weight = getEstimatedEdgeWeight(Edge);
851 // Avoid adjustment of ZERO weight since it should remain unchanged.
852 Weight != static_cast<uint32_t>(BlockExecWeight::ZERO)) {
853 // Scale down loop exiting weight by trip count.
854 Weight = std::max(
856 Weight.getValueOr(static_cast<uint32_t>(BlockExecWeight::DEFAULT)) /
861 // Avoid adjustment of ZERO weight since it should remain unchanged.
862 Weight != static_cast<uint32_t>(BlockExecWeight::ZERO)) {
863 // 'Unlikely' blocks have twice lower weight.
864 Weight = std::max(
866 Weight.getValueOr(static_cast<uint32_t>(BlockExecWeight::DEFAULT)) /
870 if (Weight)
874 Weight.getValueOr(static_cast<uint32_t>(BlockExecWeight::DEFAULT));
879 // If non of blocks have estimated weight bail out.
880 // If TotalWeight is 0 that means weight of each successor is 0 as well and
888 // If the sum of weights does not fit in 32 bits, scale every weight down
900 assert(TotalWeight <= UINT32_MAX && "Total weight overflows");