summaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-07-29 20:15:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-07-29 20:15:26 +0000
commit344a3780b2e33f6ca763666c380202b18aab72a3 (patch)
treef0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
parentb60736ec1405bb0a8dd40989f67ef4c93da068ab (diff)
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp')
-rw-r--r--llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
index e4fda2472b3a..e4e45b3076be 100644
--- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
+++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
@@ -40,12 +40,28 @@ using namespace llvm::bfi_detail;
#define DEBUG_TYPE "block-freq"
+namespace llvm {
cl::opt<bool> CheckBFIUnknownBlockQueries(
"check-bfi-unknown-block-queries",
cl::init(false), cl::Hidden,
cl::desc("Check if block frequency is queried for an unknown block "
"for debugging missed BFI updates"));
+cl::opt<bool> UseIterativeBFIInference(
+ "use-iterative-bfi-inference", cl::init(false), cl::Hidden, cl::ZeroOrMore,
+ cl::desc("Apply an iterative post-processing to infer correct BFI counts"));
+
+cl::opt<unsigned> IterativeBFIMaxIterationsPerBlock(
+ "iterative-bfi-max-iterations-per-block", cl::init(1000), cl::Hidden,
+ cl::desc("Iterative inference: maximum number of update iterations "
+ "per block"));
+
+cl::opt<double> IterativeBFIPrecision(
+ "iterative-bfi-precision", cl::init(1e-12), cl::Hidden,
+ cl::desc("Iterative inference: delta convergence precision; smaller values "
+ "typically lead to better results at the cost of worsen runtime"));
+}
+
ScaledNumber<uint64_t> BlockMass::toScaled() const {
if (isFull())
return ScaledNumber<uint64_t>(1, 0);