[PATCH] D124880: [BOLT] Fix ICPJumpTablesTopN option use
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 19:34:29 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG60957a5a08a5: [BOLT] Fix ICPJumpTablesTopN option use (authored by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124880/new/
https://reviews.llvm.org/D124880
Files:
bolt/lib/Passes/IndirectCallPromotion.cpp
Index: bolt/lib/Passes/IndirectCallPromotion.cpp
===================================================================
--- bolt/lib/Passes/IndirectCallPromotion.cpp
+++ bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -546,7 +546,7 @@
}
uint64_t RemainingMemAccesses = TotalMemAccesses;
const size_t TopN =
- opts::ICPJumpTablesTopN != 0 ? opts::ICPTopN : opts::ICPTopN;
+ opts::ICPJumpTablesTopN ? opts::ICPJumpTablesTopN : opts::ICPTopN;
size_t I = 0;
for (; I < HotTargets.size(); ++I) {
const uint64_t MemAccesses = HotTargets[I].first;
@@ -942,12 +942,11 @@
}
size_t TopN = opts::ICPTopN;
- if (IsJumpTable) {
- if (opts::ICPJumpTablesTopN != 0)
- TopN = opts::ICPJumpTablesTopN;
- } else if (opts::ICPCallsTopN != 0) {
- TopN = opts::ICPCallsTopN;
- }
+ if (IsJumpTable)
+ TopN = opts::ICPJumpTablesTopN ? opts::ICPJumpTablesTopN : TopN;
+ else
+ TopN = opts::ICPCallsTopN ? opts::ICPCallsTopN : TopN;
+
const size_t TrialN = TopN ? std::min(TopN, Targets.size()) : Targets.size();
if (opts::ICPTopCallsites > 0) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124880.426904.patch
Type: text/x-patch
Size: 1099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220504/87f3aa40/attachment.bin>
More information about the llvm-commits
mailing list