[LLVMdev] proposed change to class BasicTTI and dual mode mips16/32 working

Chandler Carruth chandlerc at google.com
Mon Apr 1 12:31:20 PDT 2013


On Thu, Mar 28, 2013 at 12:22 PM, Nadav Rotem <nrotem at apple.com> wrote:

> IMHO the right way to handle target function attributes is to
> re-initialize the target machine and TTI for every function (if the
> attributes changed).  Do you have another solution in mind ?


I don't really understand this.

TargetMachine and TTI may be quite expensive to initialize. Doing so for
each (sometimes tiny) function processed doesn't make a lot of sense to me.

Wouldn't it be better to design a TargetMachine (and TTI, or other passes
that are similar) which provides context-sensitive answers? You could
imagine this being a wrapper which delegates to one of two real TM and TTI
implementations based on a mode switch.

Alternatively, we could look at partitioning functions into two modules,
and then bring up the infrastructure once per module.

I would personally choose between these based on how much shared
functionality there would be in the TM and TTI between the two.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130401/a71389c1/attachment.html>


More information about the llvm-dev mailing list