| /llvm-project-15.0.7/bolt/lib/Passes/ |
| H A D | SplitFunctions.cpp | 89 if (!BF.hasValidProfile()) in canSplit() 177 WorkFun = [&](BinaryFunction &BF) { splitFunction<SplitCold>(BF); }; in runOnFunctions() argument 180 return !shouldOptimize(BF); in runOnFunctions() 200 if (BF.empty()) in splitFunction() 203 if (!Strategy.canSplit(BF)) in splitFunction() 283 BF.getLayout().update(NewLayout); in splitFunction() 289 if (!BC.HasFixedLoadAddress && BF.hasEHRanges() && BF.isSplit()) in splitFunction() 293 if (BC.isX86() && BF.isSplit()) { in splitFunction() 330 std::vector<BinaryBasicBlock *> Blocks(BF.pbegin(), BF.pend()); in createEHTrampolines() 378 BF.fixBranches(); in createEHTrampolines() [all …]
|
| H A D | FrameAnalysis.cpp | 107 const BinaryFunction &BF; member in llvm::bolt::__anon1bb11fe30111::FrameAccessAnalysis 175 : SPT(SPT), BC(BF.getBinaryContext()), BF(BF) {} in FrameAccessAnalysis() 364 if (ArgsTouchedMap[&BF].find(Elem) == ArgsTouchedMap[&BF].end()) { in updateArgsTouchedFor() 399 if (!BF.isSimple() || !BF.hasCFG()) { in computeArgsAccessed() 414 FrameAccessAnalysis FAA(BF, getSPT(BF)); in computeArgsAccessed() 439 ArgsTouchedMap[&BF].end()) in computeArgsAccessed() 461 for (BinaryBasicBlock &BB : BF) { in computeArgsAccessed() 473 FrameAccessAnalysis FAA(BF, getSPT(BF)); in restoreFrameIndex() 603 return !BF.isSimple() || !BF.hasCFG(); in clearSPTMap() 620 if (!BF.isSimple() || !BF.hasCFG()) in preComputeSPT() [all …]
|
| H A D | StokeInfo.cpp | 92 if (!BF.isSimple() || BF.isMultiEntry() || BF.empty()) in checkFunction() 97 FuncInfo.Offset = BF.getFileOffset(); in checkFunction() 98 FuncInfo.Size = BF.getMaxSize(); in checkFunction() 99 FuncInfo.NumInstrs = BF.getNumNonPseudos(); in checkFunction() 100 FuncInfo.NumBlocks = BF.size(); in checkFunction() 105 FuncInfo.IsLoopFree = BF.isLoopFree(); in checkFunction() 112 FuncInfo.HotSize = BF.estimateHotSize(); in checkFunction() 113 FuncInfo.TotalSize = BF.estimateSize(); in checkFunction() 114 FuncInfo.Score = BF.getFunctionScore(); in checkFunction() 116 checkInstr(BF, FuncInfo); in checkFunction() [all …]
|
| H A D | CacheMetrics.cpp | 46 for (BinaryBasicBlock &BB : *BF) { in extractBasicBlockInfo() 69 if (!BF->hasProfile()) in calcTSPScore() 71 for (BinaryBasicBlock &SrcBB : *BF) { in calcTSPScore() 94 if (!BF->hasProfile()) in calcExtTSPScore() 96 for (BinaryBasicBlock &SrcBB : *BF) { in calcExtTSPScore() 176 FunctionSamples[BF] = Samples; in expectedCacheHitRatio() 183 if (BF->getLayout().block_empty()) in expectedCacheHitRatio() 193 if (BF->getLayout().block_empty() || FunctionSamples.at(BF) == 0.0) in expectedCacheHitRatio() 262 for (BinaryFunction *BF : BFs) { in printAll() 264 if (BF->hasProfile()) in printAll() [all …]
|
| H A D | LoopInversionPass.cpp | 32 bool LoopInversionPass::runOnFunction(BinaryFunction &BF) { in runOnFunction() argument 34 if (BF.getLayout().block_size() < 3 || !BF.hasValidProfile()) in runOnFunction() 37 BF.getLayout().updateLayoutIndices(); in runOnFunction() 38 for (BinaryBasicBlock *BB : BF.getLayout().blocks()) { in runOnFunction() 75 BinaryFunction::BasicBlockOrderType NewOrder(BF.getLayout().block_begin(), in runOnFunction() 76 BF.getLayout().block_end()); in runOnFunction() 80 BF.getLayout().update(NewOrder); in runOnFunction() 92 ParallelUtilities::WorkFuncTy WorkFun = [&](BinaryFunction &BF) { in runOnFunctions() argument 93 if (runOnFunction(BF)) in runOnFunctions() 97 ParallelUtilities::PredicateTy SkipFunc = [&](const BinaryFunction &BF) { in runOnFunctions() argument [all …]
|
| H A D | MCF.cpp | 175 for (BinaryBasicBlock &BB : BF) in computeEdgeWeights() 182 for (BinaryBasicBlock &BB : BF) { in recalculateBBCounts() 212 for (BinaryBasicBlock &BB : BF) { in guessEdgeByRelHotness() 331 for (BinaryBasicBlock &BB : BF) { in guessEdgeByIterativeApproach() 361 for (BinaryBasicBlock &BB : BF) in createLoopNestLevelMap() 370 if (BF.begin() == BF.end()) in equalizeBBCounts() 386 BF.calculateLoopInfo(); in equalizeBBCounts() 388 createLoopNestLevelMap(BF); in equalizeBBCounts() 390 for (BinaryBasicBlock &BB : BF) in equalizeBBCounts() 393 for (BinaryBasicBlock &BB : BF) { in equalizeBBCounts() [all …]
|
| H A D | BinaryPasses.cpp | 244 return BF.isSimple() && BF.getState() == BinaryFunction::State::CFG && in shouldOptimize() 249 return BF.isSimple() && !BF.isIgnored(); in shouldPrint() 315 BF.fixBranches(); in runOnFunction() 324 [&](BinaryFunction &BF) { runOnFunction(BF); }, in runOnFunctions() argument 325 [&](const BinaryFunction &BF) { return !shouldOptimize(BF); }, in runOnFunctions() argument 528 BF.setFinalized(); in runOnFunctions() 571 return BF.isSimple() && !BF.isIgnored(); in shouldOptimize() 1028 [&](BinaryFunction &BF) { NumShortened += shortenInstructions(BF); }, in runOnFunctions() argument 1444 if (shouldOptimize(BF) && BF.hasValidProfile()) { in runOnFunctions() 1446 Stats.emplace(&BF, getDynoStats(BF)); in runOnFunctions() [all …]
|
| H A D | ReorderAlgorithm.cpp | 159 initQueue(Queue, BF); in clusterBasicBlocks() 210 adjustQueue(Queue, BF); in clusterBasicBlocks() 316 adjustQueue(Queue, BF); in initQueue() 506 if (BF.getLayout().block_empty()) in reorderBasicBlocks() 510 CAlgo->clusterBasicBlocks(BF); in reorderBasicBlocks() 522 if (BF.getLayout().block_empty()) in reorderBasicBlocks() 627 if (BF.getLayout().block_empty()) in reorderBasicBlocks() 635 CAlgo->clusterBasicBlocks(BF); in reorderBasicBlocks() 681 if (BF.getLayout().block_empty()) in reorderBasicBlocks() 692 if (BF.getLayout().block_empty()) in reorderBasicBlocks() [all …]
|
| H A D | AsmDump.cpp | 48 << BF << ".\n"; in dumpCFI() 60 StringRef FunctionName = BF.getOneName(); in dumpJumpTableFdata() 61 const JumpTable *JT = BF.getJumpTable(Instr); in dumpJumpTableFdata() 74 const BinaryContext &BC = BF.getBinaryContext(); in dumpTailCallFdata() 75 StringRef FunctionName = BF.getOneName(); in dumpTailCallFdata() 125 void dumpFunction(const BinaryFunction &BF) { in dumpFunction() argument 127 if (!opts::shouldPrint(BF)) in dumpFunction() 139 std::string PrintName = BF.getPrintName(); in dumpFunction() 181 StringRef FunctionName = BF.getOneName(); in dumpFunction() 208 dumpCFI(BF, Instr, *MAP.get()); in dumpFunction() [all …]
|
| H A D | Aligner.cpp | 165 alignCompact(BF, Emitter.MCE.get()); in runOnFunctions() 167 alignMaxBytes(BF); in runOnFunctions() 171 if (!BF.size() && BF.hasIslandsInfo()) { in runOnFunctions() 172 const uint16_t Alignment = BF.getConstantIslandAlignment(); in runOnFunctions() 173 if (BF.getAlignment() < Alignment) in runOnFunctions() 174 BF.setAlignment(Alignment); in runOnFunctions() 176 if (BF.getMaxAlignmentBytes() < Alignment) in runOnFunctions() 177 BF.setMaxAlignmentBytes(Alignment); in runOnFunctions() 179 if (BF.getMaxColdAlignmentBytes() < Alignment) in runOnFunctions() 180 BF.setMaxColdAlignmentBytes(Alignment); in runOnFunctions() [all …]
|
| H A D | DataflowInfoManager.cpp | 22 RD.reset(new ReachingDefOrUse<true>(*RA, BF, None, AllocatorId)); in getReachingDefs() 33 RU.reset(new ReachingDefOrUse<false>(*RA, BF, None, AllocatorId)); in getReachingUses() 44 LA.reset(new LivenessAnalysis(*RA, BF, AllocatorId)); in getLivenessAnalysis() 55 SRU.reset(new StackReachingUses(*FA, BF, AllocatorId)); in getStackReachingUses() 65 DA.reset(new DominatorAnalysis<false>(BF, AllocatorId)); in getDominatorAnalysis() 75 PDA.reset(new DominatorAnalysis<true>(BF, AllocatorId)); in getPostDominatorAnalysis() 87 SPT.reset(new StackPointerTracking(BF, AllocatorId)); in getStackPointerTracking() 100 RI.reset(new ReachingInsns<false>(BF, AllocatorId)); in getReachingInsns() 110 RIB.reset(new ReachingInsns<true>(BF, AllocatorId)); in getReachingInsnsBackwards() 123 new StackAllocationAnalysis(BF, getStackPointerTracking(), AllocatorId)); in getStackAllocationAnalysis() [all …]
|
| H A D | ADRRelaxationPass.cpp | 30 void ADRRelaxationPass::runOnFunction(BinaryFunction &BF) { in runOnFunction() argument 31 BinaryContext &BC = BF.getBinaryContext(); in runOnFunction() 32 for (BinaryBasicBlock &BB : BF) { in runOnFunction() 42 if (BF.hasIslandsInfo()) { in runOnFunction() 43 BinaryFunction::IslandInfo &Islands = BF.getIslandInfo(); in runOnFunction() 49 if (TargetBF && TargetBF == &BF) in runOnFunction() 66 ParallelUtilities::WorkFuncTy WorkFun = [&](BinaryFunction &BF) { in runOnFunctions() argument 67 runOnFunction(BF); in runOnFunctions()
|
| H A D | FrameOptimizer.cpp | 60 StackAvailableExpressions SAE(RA, FA, BF); in removeUnnecessaryLoads() 67 MCPlusBuilder *MIB = BF.getBinaryContext().MIB.get(); in removeUnnecessaryLoads() 68 for (BinaryBasicBlock &BB : BF) { in removeUnnecessaryLoads() 165 StackReachingUses SRU(FA, BF); in removeUnusedStores() 171 for (BinaryBasicBlock &BB : BF) { in removeUnusedStores() 201 if (BF.getBinaryContext().MIB->isPush(Inst)) in removeUnusedStores() 338 auto LogFunc = [&](BinaryFunction &BF) { in performShrinkWrapping() argument 346 std::make_pair<>(BF.getKnownExecutionCount(), &BF)); in performShrinkWrapping() 353 if (BF.getFunctionScore() == 0) in performShrinkWrapping() 368 FuncsChanged.insert(&BF); in performShrinkWrapping() [all …]
|
| /llvm-project-15.0.7/bolt/lib/Core/ |
| H A D | ParallelUtilities.cpp | 60 if (SkipPredicate && SkipPredicate(BF)) in computeCostFor() 67 return BF.getSize(); in computeCostFor() 69 return BF.getSize() * BF.getSize(); in computeCostFor() 71 return BF.size(); in computeCostFor() 73 return BF.size() * BF.size(); in computeCostFor() 126 BinaryFunction &BF = It->second; in runOnEachFunction() local 130 WorkFunction(BF); in runOnEachFunction() 153 BinaryFunction &BF = It->second; in runOnEachFunction() local 181 BinaryFunction &BF = It->second; in runOnEachFunctionWithUniqueAllocId() local 185 WorkFunction(BF, AllocId); in runOnEachFunctionWithUniqueAllocId() [all …]
|
| H A D | BinaryEmitter.cpp | 397 BF.duplicateConstantIslands(); in emitFunctionBody() 484 if (!BF.hasIslandsInfo()) in emitConstantIslands() 508 assert(!BF.isInjected() && in emitConstantIslands() 515 BF.getAddress() - BF.getOriginSection()->getAddress(), BF.getMaxSize()); in emitConstantIslands() 532 EndOffset = BF.getMaxSize(); in emitConstantIslands() 712 if (!BF.hasJumpTables()) in emitJumpTables() 718 for (auto &JTI : BF.jumpTables()) { in emitJumpTables() 740 if (BF.isSimple()) { in emitJumpTables() 863 EmitColdPart ? &BF.getColdCallSites() : &BF.getCallSites(); in emitLSDA() 889 EmitColdPart ? BF.getColdLSDASymbol() : BF.getLSDASymbol(); in emitLSDA() [all …]
|
| H A D | BinaryContext.cpp | 570 if (Value == BF.getAddress() + BF.getSize()) { in analyzeJumpTable() 762 setSymbolToFunctionMap(BF->getSymbol(), BF); in createBinaryFunction() 763 return BF; in createBinaryFunction() 890 if (BF.getSize() == BF.getMaxSize()) in hasValidCodePadding() 958 << Twine::utohexstr(BF.getAddress() + BF.getSize()) in hasValidCodePadding() 961 << FunctionData->slice(BF.getSize(), BF.getMaxSize() - BF.getSize()) in hasValidCodePadding() 982 BF.setMaxSize(BF.getSize()); in adjustCodePadding() 1618 if (shouldEmit(BF) && BF.getDWARFUnit()) in preprocessDebugInfo() 2133 return BF; in getFunctionForSymbol() 2160 setSymbolToFunctionMap(BF->getSymbol(), BF); in createInjectedBinaryFunction() [all …]
|
| /llvm-project-15.0.7/bolt/lib/Profile/ |
| H A D | YAMLProfileWriter.cpp | 25 void convert(const BinaryFunction &BF, in convert() argument 31 YamlBF.Name = BF.getPrintName(); in convert() 32 YamlBF.Id = BF.getFunctionNumber(); in convert() 33 YamlBF.Hash = BF.computeHash(/*UseDFS=*/true); in convert() 34 YamlBF.NumBasicBlocks = BF.size(); in convert() 37 for (const BinaryBasicBlock *BB : BF.dfs()) { in convert() 173 const BinaryFunction &BF = BFI.second; in writeProfile() local 174 if (BF.hasProfile() && !BF.empty()) { in writeProfile() 187 const BinaryFunction &BF = BFI.second; in writeProfile() local 188 if (BF.hasProfile()) { in writeProfile() [all …]
|
| H A D | YAMLProfileReader.cpp | 75 BinaryContext &BC = BF.getBinaryContext(); in parseFunctionProfile() 84 BF.setExecutionCount(YamlBF.ExecCount); in parseFunctionProfile() 92 if (YamlBF.NumBasicBlocks != BF.size()) { in parseFunctionProfile() 217 for (BinaryBasicBlock &BB : BF) in parseFunctionProfile() 223 estimateEdgeCounts(BF); in parseFunctionProfile() 229 BF.markProfiled(YamlBP.Header.Flags); in parseFunctionProfile() 272 BinaryFunction &BF = KV.second; in preprocessProfile() local 273 for (StringRef Name : BF.getNames()) { in preprocessProfile() 277 BF.setExecutionCount(YamlBF.ExecCount); in preprocessProfile() 287 for (StringRef Name : BF.getNames()) { in mayHaveProfileData() [all …]
|
| H A D | DataReader.cpp | 360 if (BF.empty()) in readProfile() 365 readSampleData(BF); in readProfile() 372 matchProfileData(BF); in readProfile() 407 convertBranchData(BF); in readProfile() 419 BF.ProfileMatchRatio = evaluateProfileData(BF, *FBD); in matchProfileData() 423 BF.ProfileMatchRatio = evaluateProfileData(BF, *FBD); in matchProfileData() 434 if (!hasVolatileName(BF)) in matchProfileData() 575 BF.removeTagsFromProfile(); in readSampleData() 591 for (auto I = BF.BasicBlockOffsets.rbegin(), E = BF.BasicBlockOffsets.rend(); in readSampleData() 612 estimateEdgeCounts(BF); in readSampleData() [all …]
|
| /llvm-project-15.0.7/bolt/include/bolt/Passes/ |
| H A D | ReorderAlgorithm.h | 88 const BinaryFunction &BF) = 0; 101 void clusterBasicBlocks(const BinaryFunction &BF, 112 const BinaryFunction &BF) override; 139 const BinaryFunction &BF) override; 188 void reorderBasicBlocks(const BinaryFunction &BF, 199 void reorderBasicBlocks(const BinaryFunction &BF, 212 void reorderBasicBlocks(const BinaryFunction &BF, 225 void reorderBasicBlocks(const BinaryFunction &BF, 232 void reorderBasicBlocks(const BinaryFunction &BF, 239 void reorderBasicBlocks(const BinaryFunction &BF, [all …]
|
| H A D | BinaryPasses.h | 38 virtual bool shouldOptimize(const BinaryFunction &BF) const; 51 virtual bool shouldPrint(const BinaryFunction &BF) const; 95 void runOnFunction(BinaryFunction &BF); 119 bool shouldPrint(const BinaryFunction &BF) const override { in shouldPrint() argument 120 return BinaryFunctionPass::shouldPrint(BF) && Modified.count(&BF) > 0; in shouldPrint() 165 bool shouldPrint(const BinaryFunction &BF) const override; 271 uint64_t fixTailCalls(BinaryFunction &BF); 280 bool shouldPrint(const BinaryFunction &BF) const override { in shouldPrint() argument 281 return BinaryFunctionPass::shouldPrint(BF) && Modified.count(&BF) > 0; in shouldPrint() 351 bool simplifyRODataLoads(BinaryFunction &BF); [all …]
|
| H A D | FrameAnalysis.h | 153 bool updateArgsTouchedFor(const BinaryFunction &BF, MCInst &Inst, 160 bool computeArgsAccessed(BinaryFunction &BF); 166 bool restoreFrameIndex(BinaryFunction &BF); 213 StackPointerTracking &getSPT(BinaryFunction &BF) { in getSPT() argument 214 if (!SPTMap.count(&BF)) { in getSPT() 215 SPTMap.emplace(&BF, std::make_unique<StackPointerTracking>(BF)); in getSPT() 216 auto Iter = SPTMap.find(&BF); in getSPT() 222 auto Iter = SPTMap.find(&BF); in getSPT()
|
| H A D | ShrinkWrapping.h | 26 BinaryFunction &BF; variable 64 CalleeSavedAnalysis(const FrameAnalysis &FA, BinaryFunction &BF, in CalleeSavedAnalysis() argument 67 : FA(FA), BC(BF.getBinaryContext()), BF(BF), Info(Info), in CalleeSavedAnalysis() 120 BinaryFunction &BF; variable 222 : FA(FA), BC(BF.getBinaryContext()), BF(BF), Info(Info), in StackLayoutModifier() 226 for (BinaryBasicBlock &BB : BF) { in ~StackLayoutModifier() 292 BinaryFunction &BF; variable 512 : FA(FA), BC(BF.getBinaryContext()), BF(BF), Info(Info), in ShrinkWrapping() 513 AllocatorId(AllocId), SLM(FA, BF, Info, AllocId), in ShrinkWrapping() 514 CSA(FA, BF, Info, AllocId) {} in ShrinkWrapping() [all …]
|
| /llvm-project-15.0.7/clang/test/CodeGen/ |
| H A D | 2003-09-18-BitfieldTests.c | 4 typedef struct BF { struct 8 } BF; typedef 10 char *test1(BF *b) { in test1() 14 void test2(BF *b) { // Increment and decrement operators in test2() 19 void test3(BF *b) { in test3() 23 int test4(BF *b) { in test4() 27 void test5(BF *b, int i) { // array ref in test5()
|
| /llvm-project-15.0.7/bolt/tools/merge-fdata/ |
| H A D | merge-fdata.cpp | 189 if (SI.Index >= BF.NumBasicBlocks) in mergeBasicBlockProfile() 190 report_error(BF.Name, "bad successor index"); in mergeBasicBlockProfile() 213 if (BF.Id != MergedBF.Id) in mergeFunctionProfile() 214 report_error(BF.Name, "ID mismatch"); in mergeFunctionProfile() 215 if (BF.Hash != MergedBF.Hash) in mergeFunctionProfile() 216 report_error(BF.Name, "hash mismatch"); in mergeFunctionProfile() 219 MergedBF.ExecCount += BF.ExecCount; in mergeFunctionProfile() 223 for (BinaryBasicBlockProfile &BB : BF.Blocks) { in mergeFunctionProfile() 224 if (BB.Index >= BF.NumBasicBlocks) in mergeFunctionProfile() 385 if (!MergedBFs.count(BF.Name)) { in main() [all …]
|