[PATCH] D18321: Add support for no-jump-tables

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 07:22:36 PDT 2016


niravd added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7930
@@ -7929,1 +7929,3 @@
 
+  if (TM.Options.NoUseJumpTables)
+    return false;
----------------
hans wrote:
> There is already a helper function in this file that decides whether or not to build jump tables: areJTsAllowed(). That's a better place to do this check.
> 
> If we really want to disable jump tables, maybe the proper thing to do is to make TLI.isOperationLegalOrCustom(BR_JT) return false. I don't know if that's more or less convenient to do, though.
Realized I hadn't addressed this. This was probably the right thing originally, but isn't possible now that no-jump-tables is a function attribute. 


http://reviews.llvm.org/D18321





More information about the llvm-commits mailing list