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

Tom Roeder tmroeder at google.com
Thu Jun 5 12:42:24 PDT 2014


On Wed, Jun 4, 2014 at 12:53 PM, Tom Roeder <tmroeder at google.com> wrote:
> 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.

I removed both globals and used TargetOptions for the jumptable-table type flag.

Committed as r210280.

Feedback on the small amount of X86 and ARM Target code would still be
appreciated.

Thanks,

Tom



More information about the llvm-commits mailing list