mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
[CodeGen] Refactor the option for the maximum jump table size
Refactor the option `max-jump-table-size` to default to the maximum representable number. Essentially, NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cbcef203c2
commit
e5ec07fa48
@ -956,9 +956,7 @@ public:
|
||||
const bool OptForSize = SI->getParent()->getParent()->optForSize();
|
||||
const unsigned MinDensity = getMinimumJumpTableDensity(OptForSize);
|
||||
const unsigned MaxJumpTableSize =
|
||||
OptForSize || getMaximumJumpTableSize() == 0
|
||||
? UINT_MAX
|
||||
: getMaximumJumpTableSize();
|
||||
OptForSize ? UINT_MAX : getMaximumJumpTableSize();
|
||||
// Check whether a range of clusters is dense enough for a jump table.
|
||||
if (Range <= MaxJumpTableSize &&
|
||||
(NumCases * 100 >= Range * MinDensity)) {
|
||||
|
@ -73,8 +73,8 @@ static cl::opt<unsigned> MinimumJumpTableEntries
|
||||
cl::desc("Set minimum number of entries to use a jump table."));
|
||||
|
||||
static cl::opt<unsigned> MaximumJumpTableSize
|
||||
("max-jump-table-size", cl::init(0), cl::Hidden,
|
||||
cl::desc("Set maximum size of jump tables; zero for no limit."));
|
||||
("max-jump-table-size", cl::init(UINT_MAX), cl::Hidden,
|
||||
cl::desc("Set maximum size of jump tables."));
|
||||
|
||||
/// Minimum jump table density for normal functions.
|
||||
static cl::opt<unsigned>
|
||||
|
@ -613,9 +613,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
|
||||
setPrefLoopAlignment(STI.getPrefLoopAlignment());
|
||||
|
||||
// Only change the limit for entries in a jump table if specified by
|
||||
// the subtarget, but not at the command line.
|
||||
// the sub target, but not at the command line.
|
||||
unsigned MaxJT = STI.getMaximumJumpTableSize();
|
||||
if (MaxJT && getMaximumJumpTableSize() == 0)
|
||||
if (MaxJT && getMaximumJumpTableSize() == UINT_MAX)
|
||||
setMaximumJumpTableSize(MaxJT);
|
||||
|
||||
setHasExtractBitsInsn(true);
|
||||
|
Loading…
Reference in New Issue
Block a user