diff options
author | Evandro Menezes <e.menezes@samsung.com> | 2016-10-25 19:53:51 +0000 |
---|---|---|
committer | Evandro Menezes <e.menezes@samsung.com> | 2016-10-25 19:53:51 +0000 |
commit | eb97e3554c695e3d0005ab1d360c99a77af5aaf4 (patch) | |
tree | f701f1dbd535918f7b10df84c8f34f3040070cce /llvm/lib/CodeGen | |
parent | 22c1b7c1d82f484ef531a4d913becb84bebbe43e (diff) | |
download | bcm5719-llvm-eb97e3554c695e3d0005ab1d360c99a77af5aaf4.tar.gz bcm5719-llvm-eb97e3554c695e3d0005ab1d360c99a77af5aaf4.zip |
Add option to specify minimum number of entries for jump tables
Add an option to allow easier experimentation by target maintainers with the
minimum number of entries to create jump tables. Also clarify the name of
the other existing option governing the creation of jump tables.
Differential revision: https://reviews.llvm.org/D25883
llvm-svn: 285104
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 410169788c8..afa3fa98ad8 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -45,9 +45,13 @@ static cl::opt<bool> JumpIsExpensiveOverride( cl::desc("Do not create extra branches to split comparison logic."), cl::Hidden); +static cl::opt<unsigned> MinimumJumpTableEntries + ("min-jump-table-entries", cl::init(4), cl::Hidden, + cl::desc("Set minimum number of entries to use a jump table.")); + static cl::opt<unsigned> MaximumJumpTableSize - ("max-jump-table", cl::init(0), cl::Hidden, - cl::desc("Set maximum number of jump table entries; zero for no limit.")); + ("max-jump-table-size", cl::init(0), cl::Hidden, + cl::desc("Set maximum size of jump tables; zero for no limit.")); // Although this default value is arbitrary, it is not random. It is assumed // that a condition that evaluates the same way by a higher percentage than this @@ -826,7 +830,6 @@ TargetLoweringBase::TargetLoweringBase(const TargetMachine &tm) : TM(tm) { PrefLoopAlignment = 0; GatherAllAliasesMaxDepth = 6; MinStackArgumentAlignment = 1; - MinimumJumpTableEntries = 4; // TODO: the default will be switched to 0 in the next commit, along // with the Target-specific changes necessary. MaxAtomicSizeInBitsSupported = 1024; @@ -1868,6 +1871,14 @@ Value *TargetLoweringBase::getSSPStackGuardCheck(const Module &M) const { return nullptr; } +unsigned TargetLoweringBase::getMinimumJumpTableEntries() const { + return MinimumJumpTableEntries; +} + +void TargetLoweringBase::setMinimumJumpTableEntries(unsigned Val) { + MinimumJumpTableEntries = Val; +} + unsigned TargetLoweringBase::getMaximumJumpTableSize() const { return MaximumJumpTableSize; } |