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

Nick Lewycky nlewycky at google.com
Thu Jun 5 13:06:09 PDT 2014


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?

I OK'd the patch to land when Tom asked me about it offlist.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140605/a272d3dd/attachment.html>


More information about the llvm-commits mailing list