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

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 07:05:51 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; }
----------------
VyacheslavLevytskyy wrote:

I think we are forced to manage this on a lower level than user options. This backend clearly doesn't support jump tables at the moment, so lowering switches indeed should ignore -fjump-tables/-fno-jump-tables until the corresponding support is added to the project.

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


More information about the llvm-commits mailing list