]> granicus.if.org Git - llvm/commitdiff
[CodeGen] Refactor the option for the maximum jump table size
authorEvandro Menezes <e.menezes@samsung.com>
Fri, 29 Mar 2019 17:28:11 +0000 (17:28 +0000)
committerEvandro Menezes <e.menezes@samsung.com>
Fri, 29 Mar 2019 17:28:11 +0000 (17:28 +0000)
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

include/llvm/CodeGen/TargetLowering.h
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp

index 1ec4035568cbb37d9e8b99dd8247636082d06c1e..cb1ae5797389b9b36d56d8b65d406dac61abcaaf 100644 (file)
@@ -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)) {
index 41cf19f1761be21fd8f018f60a6b7d7e5835f552..312579fb14c163cca3729f1a2d1090067ea23df0 100644 (file)
@@ -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>
index 3d72949f1c6e46fcc981c89d26312a25cea2f4e1..ff6d30bbb10e6ae1a035f2b2daf6bf708b56464e 100644 (file)
@@ -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);