Lines Matching defs:Weights
17 // - prof: Represents branch weights. This annotation is added to branches
18 // to indicate the weights of each edge coming out of the branch.
102 "sample block/edge weights through the CFG."));
228 /// Map basic blocks to their computed weights.
231 /// of all the instruction weights in that block.
234 /// Map edges to their computed weights.
236 /// Edge weights are computed by propagating basic block weights in
246 /// Equivalence classes for block weights.
462 /// Clear all the per-function data used to load samples and propagate weights.
596 /// Compute and store the weights of every basic block.
599 /// the weights of every basic block in the CFG.
604 LLVM_DEBUG(dbgs() << "Block weights\n");
910 /// the weights of all the blocks in the same equivalence class to the same
949 // Assign weights to equivalence classes.
987 /// Propagate weights through incoming/outgoing edges.
999 /// \returns True if new weights were assigned to edges or blocks.
1045 // - All the edge weights are known (i.e., NumUnknownEdges == 0).
1054 // edge weights. If the edges weight more than BB, then the
1071 // of all edge weights.
1075 LLVM_DEBUG(dbgs() << "All edge weights for " << BB->getName()
1098 // Edge weights should never exceed the BB weights it connects.
1108 // If a block Weights 0, all its in/out edges should weight 0.
1191 /// Propagate weights into edges
1239 // BBs. The 2nd propagation pass resets edges weights, and use all BB weights
1240 // to propagate edge weights.
1247 // The 3rd propagation pass allows adjust annotated BB weights that are
1255 // edge weights computed during propagation.
1256 LLVM_DEBUG(dbgs() << "\nPropagation complete. Setting branch weights\n");
1289 SmallVector<uint32_t, 1> Weights;
1290 Weights.push_back(BlockWeights[BB]);
1291 I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights));
1302 LLVM_DEBUG(dbgs() << "\nGetting weights for branch at line "
1306 SmallVector<uint32_t, 4> Weights;
1314 // Use uint32_t saturated arithmetic to adjust the incoming weights,
1316 // but internally branch weights are expressed as 32-bit values.
1322 // 0 weights.
1323 Weights.push_back(static_cast<uint32_t>(Weight + 1));
1333 // Only set weights if there is at least one non-zero weight.
1334 // In any other case, let the analyzer set weights.
1335 // Do not set weights if the weights are present. In ThinLTO, the profile
1337 // weights, the second pass does not need to set it.
1339 LLVM_DEBUG(dbgs() << "SUCCESS. Found non-zero weights.\n");
1341 MDB.createBranchWeights(Weights));
1348 LLVM_DEBUG(dbgs() << "SKIPPED. All branch weights are zero.\n");
1392 /// Branch weights are computed out of instruction samples using a
1395 /// 1- Assignment of block weights. All the basic blocks in the function
1400 /// blocks, we can fill in the gaps by setting the weights of all the
1406 /// 3- Propagation of block weights into edges. This uses a simple
1433 /// Once all the branch weights are computed, we emit the MD_prof
1451 // Compute basic block weights.
1470 // Propagate weights to all edges.