[llvm] Prevent creation of jump tables from switch (PR #82287)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 23:38:36 PST 2024


================
@@ -31,6 +31,10 @@ class SPIRVTargetLowering : public TargetLowering {
     return true;
   }
 
+  // Set the lower limit for number of blocks in a jump table in such a way to
+  // prevent creation of jump tables from switch
+  unsigned getMinimumJumpTableEntries() const override { return 0xffffffff; }
----------------
Keenuts wrote:

Wouldn't override `areJTsAllowed` more correct?
https://llvm.org/doxygen/classllvm_1_1TargetLoweringBase.html#a392f6e72d46ff14ee31481e3452f6c31

https://github.com/llvm/llvm-project/pull/82287


More information about the llvm-commits mailing list