/external/llvm/lib/Analysis/ |
D | BlockFrequencyInfoImpl.cpp | 115 Weights.push_back(Weight(Type, Node, Amount)); in add() 133 static void combineWeightsBySorting(WeightList &Weights) { in combineWeightsBySorting() argument 135 std::sort(Weights.begin(), Weights.end(), in combineWeightsBySorting() 140 WeightList::iterator O = Weights.begin(); in combineWeightsBySorting() 141 for (WeightList::const_iterator I = O, L = O, E = Weights.end(); I != E; in combineWeightsBySorting() 151 Weights.erase(O, Weights.end()); in combineWeightsBySorting() 154 static void combineWeightsByHashing(WeightList &Weights) { in combineWeightsByHashing() argument 157 HashTable Combined(NextPowerOf2(2 * Weights.size())); in combineWeightsByHashing() 158 for (const Weight &W : Weights) in combineWeightsByHashing() 162 if (Weights.size() == Combined.size()) in combineWeightsByHashing() [all …]
|
D | BranchProbabilityInfo.cpp | 205 SmallVector<uint32_t, 2> Weights; in calcMetadataWeights() local 206 Weights.reserve(TI->getNumSuccessors()); in calcMetadataWeights() 214 Weights.push_back(Weight->getZExtValue()); in calcMetadataWeights() 215 WeightSum += Weights.back(); in calcMetadataWeights() 217 assert(Weights.size() == TI->getNumSuccessors() && "Checked above"); in calcMetadataWeights() 226 uint32_t W = Weights[i] / ScalingFactor; in calcMetadataWeights() 519 Weights.clear(); in releaseMemory() 588 Weights.find(std::make_pair(Src, IndexInSuccessors)); in getEdgeWeight() 590 if (I != Weights.end()) in getEdgeWeight() 610 MapI = Weights.find(std::make_pair(Src, I.getSuccessorIndex())); in getEdgeWeight() [all …]
|
/external/llvm/lib/Transforms/Scalar/ |
D | LowerExpectIntrinsic.cpp | 60 SmallVector<uint32_t, 16> Weights(n + 1, UnlikelyBranchWeight); in handleSwitchExpect() local 63 Weights[0] = LikelyBranchWeight; in handleSwitchExpect() 65 Weights[Case.getCaseIndex() + 1] = LikelyBranchWeight; in handleSwitchExpect() 68 MDBuilder(CI->getContext()).createBranchWeights(Weights)); in handleSwitchExpect()
|
D | JumpThreading.cpp | 1651 SmallVector<uint32_t, 4> Weights; in UpdateBlockFreqAndEdgeWeight() local 1653 Weights.push_back(static_cast<uint32_t>(Freq)); in UpdateBlockFreqAndEdgeWeight() 1656 for (int I = 0, E = Weights.size(); I < E; I++) in UpdateBlockFreqAndEdgeWeight() 1657 BPI->setEdgeWeight(BB, I, Weights[I]); in UpdateBlockFreqAndEdgeWeight() 1659 if (Weights.size() >= 2) { in UpdateBlockFreqAndEdgeWeight() 1663 MDBuilder(TI->getParent()->getContext()).createBranchWeights(Weights)); in UpdateBlockFreqAndEdgeWeight()
|
/external/llvm/lib/IR/ |
D | MDBuilder.cpp | 42 MDNode *MDBuilder::createBranchWeights(ArrayRef<uint32_t> Weights) { in createBranchWeights() argument 43 assert(Weights.size() >= 2 && "Need at least two branch weights!"); in createBranchWeights() 45 SmallVector<Metadata *, 4> Vals(Weights.size() + 1); in createBranchWeights() 49 for (unsigned i = 0, e = Weights.size(); i != e; ++i) in createBranchWeights() 50 Vals[i + 1] = createConstant(ConstantInt::get(Int32Ty, Weights[i])); in createBranchWeights()
|
/external/llvm/lib/Transforms/Utils/ |
D | SimplifyCFG.cpp | 707 SmallVector<uint32_t, 8> Weights; in SimplifyEqualityComparisonWithOnlyPredecessor() local 714 Weights.push_back(CI->getValue().getZExtValue()); in SimplifyEqualityComparisonWithOnlyPredecessor() 720 std::swap(Weights[i.getCaseIndex()+1], Weights.back()); in SimplifyEqualityComparisonWithOnlyPredecessor() 721 Weights.pop_back(); in SimplifyEqualityComparisonWithOnlyPredecessor() 727 if (HasWeight && Weights.size() >= 2) in SimplifyEqualityComparisonWithOnlyPredecessor() 730 createBranchWeights(Weights)); in SimplifyEqualityComparisonWithOnlyPredecessor() 814 SmallVectorImpl<uint64_t> &Weights) { in GetBranchWeights() argument 819 Weights.push_back(CI->getValue().getZExtValue()); in GetBranchWeights() 826 assert(Weights.size() == 2); in GetBranchWeights() 829 std::swap(Weights.front(), Weights.back()); in GetBranchWeights() [all …]
|
D | Local.cpp | 147 SmallVector<uint32_t, 8> Weights; in ConstantFoldTerminator() local 153 Weights.push_back(CI->getValue().getZExtValue()); in ConstantFoldTerminator() 157 Weights[0] += Weights[idx+1]; in ConstantFoldTerminator() 159 std::swap(Weights[idx+1], Weights.back()); in ConstantFoldTerminator() 160 Weights.pop_back(); in ConstantFoldTerminator() 163 createBranchWeights(Weights)); in ConstantFoldTerminator()
|
/external/clang/lib/CodeGen/ |
D | CodeGenPGO.cpp | 809 CodeGenFunction::createProfileWeights(ArrayRef<uint64_t> Weights) { in createProfileWeights() argument 811 if (Weights.size() < 2) in createProfileWeights() 815 uint64_t MaxWeight = *std::max_element(Weights.begin(), Weights.end()); in createProfileWeights() 823 ScaledWeights.reserve(Weights.size()); in createProfileWeights() 824 for (uint64_t W : Weights) in createProfileWeights()
|
D | CGStmt.cpp | 1107 llvm::MDNode *Weights = nullptr; in EmitCaseStmtRange() local 1111 Weights = createProfileWeights(ThisCount, DefaultCount); in EmitCaseStmtRange() 1118 Builder.CreateCondBr(Cond, CaseDest, FalseDest, Weights); in EmitCaseStmtRange()
|
D | CodeGenFunction.cpp | 1300 llvm::MDNode *Weights = in EmitBranchOnBoolExpr() local 1309 Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable); in EmitBranchOnBoolExpr()
|
D | CodeGenFunction.h | 947 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights);
|
/external/llvm/lib/Transforms/Instrumentation/ |
D | PGOInstrumentation.cpp | 655 SmallVector<unsigned, 4> Weights; in setBranchWeights() local 657 Weights.push_back(scaleBranchCount(ECI, Scale)); in setBranchWeights() 660 MDB.createBranchWeights(Weights)); in setBranchWeights() 662 for (const auto &W : Weights) { dbgs() << W << " "; } in setBranchWeights()
|
/external/llvm/include/llvm/IR/ |
D | MDBuilder.h | 61 MDNode *createBranchWeights(ArrayRef<uint32_t> Weights);
|
D | IRBuilder.h | 604 InstTy *addBranchMetadata(InstTy *I, MDNode *Weights, MDNode *Unpredictable) { in addBranchMetadata() argument 605 if (Weights) in addBranchMetadata() 606 I->setMetadata(LLVMContext::MD_prof, Weights); in addBranchMetadata()
|
/external/llvm/lib/CodeGen/ |
D | StackProtector.cpp | 460 MDNode *Weights = MDBuilder(F->getContext()) in InsertStackProtectors() local 462 B.CreateCondBr(Cmp, NewBB, FailBB, Weights); in InsertStackProtectors()
|
/external/llvm/include/llvm/Analysis/ |
D | BranchProbabilityInfo.h | 138 DenseMap<Edge, uint32_t> Weights; variable
|
D | BlockFrequencyInfoImpl.h | 350 WeightList Weights; ///< Individual successor weights.
|
/external/llvm/unittests/IR/ |
D | IRBuilderTest.cpp | 95 MDNode *Weights = MDBuilder(Ctx).createBranchWeights(42, 13); in TEST_F() local 96 BI = Builder.CreateCondBr(Builder.getTrue(), TBB, FBB, Weights); in TEST_F() 102 EXPECT_EQ(Weights, TI->getMetadata(LLVMContext::MD_prof)); in TEST_F()
|
/external/llvm/lib/Transforms/IPO/ |
D | SampleProfile.cpp | 1031 SmallVector<uint32_t, 4> Weights; in propagateWeights() local 1046 Weights.push_back(static_cast<uint32_t>(Weight)); in propagateWeights() 1060 MDB.createBranchWeights(Weights)); in propagateWeights()
|
/external/llvm/docs/ |
D | BlockFrequencyTerminology.rst | 26 Weights are relative to the other edges of a given predecessor block. The
|