[PATCH] D24638: [thinlto] Basic thinlto fdo heuristic
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 16 10:43:48 PDT 2016
mehdi_amini added a comment.
Great to see this!
Can you add a test with three functions, hot/cold/unknown, and show the impact of the importing with a fixed `-import-instr-limit` and varying `-import-hot-multiplier`?
================
Comment at: lib/Analysis/ModuleSummaryAnalysis.cpp:113
@@ -101,1 +112,3 @@
+ ScaledCount ? getHotness(ScaledCount.getValue(), PSI)
+ : CalleeInfo::HotnessType::Unknown);
} else {
----------------
Can you split the statement:
```
auto Hotness = ScaledCount ? getHotness(ScaledCount.getValue(), PSI)
: CalleeInfo::HotnessType::Unknown;
CallGraphEdges[CalleeId].updateHotness(Hotness);
```
Same number of lines, but the flow is easier to read.
================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:382
@@ -381,1 +381,3 @@
+ ProfileSummaryInfo PSI(TheModule);
+ auto Index = buildModuleSummaryIndex(TheModule, nullptr, PSI);
WriteBitcodeToFile(&TheModule, OS, true, &Index);
----------------
At this point, not having PSI (i.e. making it optional is fine).
https://reviews.llvm.org/D24638
More information about the llvm-commits
mailing list