[PATCH] Add a jumptable attribute and support for creating jump-instruction tables

Tom Roeder tmroeder at google.com
Wed Jun 4 12:53:10 PDT 2014


On Tue, Jun 3, 2014 at 3:37 PM, Nick Lewycky <nlewycky at google.com> wrote:
> + static cl::opt<bool>
> + BuildJumpInstrTables(
> +     "build-jump-instr-tables", cl::Hidden, cl::init(false),
> +     cl::desc("Build jump-instruction tables for address-taken
> functions"));
>
> No. Firstly, such globals are forbidden on the grounds that they're
> thread-unsafe, consider TargetOptions instead. Yes we still have some, no
> you can't add more. It looks like this controls whether we actually do the
> jump-table substitution. Please remove it, replacing it with true. We
> already have a control for whether to do jump instruction tables, and that's
> the presence or absence of the "jumptable" attribute on each function.

There's also another flag: it's in JumpInstrTables.cpp and it selects
the type of table to build. From your comments, it sounds like the
right thing to do with it is to put it into TargetOptions and add a
constructor to JumpInstrTables that specifies the type of table to
use.



More information about the llvm-commits mailing list