summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-04-06 21:32:36 +0000
committerVitaly Buka <vitalybuka@google.com>2018-04-06 21:32:36 +0000
commit66f53d71f7e0ff1c2811ec6741af511c588fd038 (patch)
treeaf7a7eb33011a4153f7d8949e66efb037c3e09c1 /llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
parent4564ed1430774e84b49adaee633dbf1699104c76 (diff)
downloadbcm5719-llvm-66f53d71f7e0ff1c2811ec6741af511c588fd038.tar.gz
bcm5719-llvm-66f53d71f7e0ff1c2811ec6741af511c588fd038.zip
Runtime flag to control branch funnel threshold
Reviewers: pcc Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45193 llvm-svn: 329459
Diffstat (limited to 'llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index a3aa7c42608..2c08cd82a5b 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -111,6 +111,11 @@ static cl::opt<std::string> ClWriteSummary(
cl::desc("Write summary to given YAML file after running pass"),
cl::Hidden);
+static cl::opt<int> ClThreshold("wholeprogramdevirt-branch-funnel-threshold",
+ cl::Hidden, cl::init(10), cl::ZeroOrMore,
+ cl::desc("Maximum number of call targets per "
+ "call site to enable branch funnels"));
+
// Find the minimum offset that we may store a value of size Size bits at. If
// IsAfter is set, look for an offset before the object, otherwise look for an
// offset after the object.
@@ -820,8 +825,7 @@ void DevirtModule::tryICallBranchFunnel(
if (T.getArch() != Triple::x86_64)
return;
- const unsigned kBranchFunnelThreshold = 10;
- if (TargetsForSlot.size() > kBranchFunnelThreshold)
+ if (TargetsForSlot.size() > ClThreshold)
return;
bool HasNonDevirt = !SlotInfo.CSInfo.AllCallSitesDevirted;
OpenPOWER on IntegriCloud