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

Tom Roeder tmroeder at google.com
Thu Jun 5 13:07:49 PDT 2014


On Thu, Jun 5, 2014 at 1:06 PM, Nick Lewycky <nlewycky at google.com> wrote:
> On 4 June 2014 12:53, 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.
>
>
> For the benefit of the public review log, I thought I had sent out this
> email, but it was still a draft:
>
> Yes, you are correct. Maybe you can make the JumpInstrTablesPass take an
> argument in its constructor and thread it through LLVMTargetMachine for
> instance?

Yes, that's what I ended up doing in the submitted version.



More information about the llvm-commits mailing list