[PATCH] D122442: [CSSPGO] Turn on profi and ext-tsp when using probe-based profile.
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 16:44:50 PDT 2022
hoy updated this revision to Diff 418084.
hoy added a comment.
Updating D122442 <https://reviews.llvm.org/D122442>: [CSSPGO] Turn on profi and ext-tsp when using probe-based profile.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122442/new/
https://reviews.llvm.org/D122442
Files:
llvm/lib/Transforms/IPO/SampleProfile.cpp
Index: llvm/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2001,7 +2001,17 @@
/*EmitRemarks=*/false);
}
- // Apply tweaks if context-sensitive profile is available.
+ // Apply tweaks if context-sensitive or probe-based profile is available.
+ if (Reader->profileIsCSFlat() || Reader->profileIsCSNested() ||
+ Reader->profileIsProbeBased()) {
+ if (!UseIterativeBFIInference.getNumOccurrences())
+ UseIterativeBFIInference = true;
+ if (!SampleProfileUseProfi.getNumOccurrences())
+ SampleProfileUseProfi = true;
+ if (!EnableExtTspBlockPlacement.getNumOccurrences())
+ EnableExtTspBlockPlacement = true;
+ }
+
if (Reader->profileIsCSFlat() || Reader->profileIsCSNested()) {
ProfileIsCSFlat = Reader->profileIsCSFlat();
// Enable priority-base inliner and size inline by default for CSSPGO.
@@ -2018,17 +2028,6 @@
if (!AllowRecursiveInline.getNumOccurrences())
AllowRecursiveInline = true;
- // Enable iterative-BFI by default for CSSPGO.
- if (!UseIterativeBFIInference.getNumOccurrences())
- UseIterativeBFIInference = true;
- // Enable Profi by default for CSSPGO.
- if (!SampleProfileUseProfi.getNumOccurrences())
- SampleProfileUseProfi = true;
-
- // Enable EXT-TSP block layout for CSSPGO.
- if (!EnableExtTspBlockPlacement.getNumOccurrences())
- EnableExtTspBlockPlacement = true;
-
if (FunctionSamples::ProfileIsCSFlat) {
// Tracker for profiles under different context
ContextTracker = std::make_unique<SampleContextTracker>(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122442.418084.patch
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220324/84ee569c/attachment.bin>
More information about the llvm-commits
mailing list