diff options
| author | Vedant Kumar <vsk@apple.com> | 2019-01-19 02:38:17 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2019-01-19 02:38:17 +0000 |
| commit | 4de1962bb9110ab48b0cd95a5d1db17a4653a700 (patch) | |
| tree | 075e5086fa675de990f9a0fefb81d7a3f21dfa76 | |
| parent | 17d9f14bffc28d200a3ccef75b9409cd0e6bba86 (diff) | |
| download | bcm5719-llvm-4de1962bb9110ab48b0cd95a5d1db17a4653a700.tar.gz bcm5719-llvm-4de1962bb9110ab48b0cd95a5d1db17a4653a700.zip | |
[HotColdSplit] Remove a set which tracked split functions (NFC)
Use the begin/end iterator idiom to avoid visiting split functions,
instead of doing a set lookup.
llvm-svn: 351622
| -rw-r--r-- | llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 6876ae60259..d6ac7183f77 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -183,7 +183,6 @@ private: Function *extractColdRegion(const BlockSequence &Region, DominatorTree &DT, BlockFrequencyInfo *BFI, TargetTransformInfo &TTI, OptimizationRemarkEmitter &ORE, unsigned Count); - SmallPtrSet<const Function *, 2> OutlinedFunctions; ProfileSummaryInfo *PSI; function_ref<BlockFrequencyInfo *(Function &)> GetBFI; function_ref<TargetTransformInfo &(Function &)> GetTTI; @@ -212,10 +211,6 @@ public: // Returns false if the function should not be considered for hot-cold split // optimization. bool HotColdSplitting::shouldOutlineFrom(const Function &F) const { - // Do not try to outline again from an already outlined cold function. - if (OutlinedFunctions.count(&F)) - return false; - if (F.size() <= 2) return false; @@ -540,7 +535,6 @@ bool HotColdSplitting::outlineColdRegions(Function &F, ProfileSummaryInfo &PSI, extractColdRegion(SubRegion, DT, BFI, TTI, ORE, OutlinedFunctionID); if (Outlined) { ++OutlinedFunctionID; - OutlinedFunctions.insert(Outlined); Changed = true; } } while (!Region.empty()); @@ -551,8 +545,9 @@ bool HotColdSplitting::outlineColdRegions(Function &F, ProfileSummaryInfo &PSI, bool HotColdSplitting::run(Module &M) { bool Changed = false; - OutlinedFunctions.clear(); - for (auto &F : M) { + for (auto It = M.begin(), End = M.end(); It != End; ++It) { + Function &F = *It; + if (!shouldOutlineFrom(F)) { LLVM_DEBUG(llvm::dbgs() << "Skipping " << F.getName() << "\n"); continue; |

