[patch] opt: Initialize asm printers to avoid DCE

Chandler Carruth chandlerc at google.com
Tue May 27 15:29:27 PDT 2014


On Tue, May 20, 2014 at 2:57 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > Right. This could probably be "fixed" but it seems the improvements in
> terms
> > of code size are rather small.
> >
> >
> >> What is the plugin doing with the asm printer? Could it plugin in llc?
> >
> >
> > It is a LLVM-IR optimizer that extracts parts of the LLVM IR, translates
> > them to PTX, stores the PTX in a global variable and generates calls to
> the
> > CUDA run-time to load and run this code instead of the original code.
> >
> > Do you think it would be better to immediately restructure opt's linking
> to
> > not link the asm printers? I looked into this briefly, but it seems to
> be a
> > larger refactoring that adds a lot of complexity.
>
> I am honestly not sure. There were some discussions about what should
> be in opt or in llc in the future. I remember proposals ranging from
> opt not linking to CodeGen to just merging the two. I don't have a
> strong opinion on the direction, but it would be nice to know that
> this patch is pointing the right way.
>
> Chandler, do you know what the current consensus is?


There are an increasing number of IR-level passes that can query into
target-specific information. Testing these from 'llc' is kind of horrible,
and so the plan of record AFAIK is to freely allow the 'opt' tool to link
bits of the target libraries.

While I'm of two minds about the specific use case, I think there are
*many* use cases for an 'opt' plugin to want to use the rest of LLVM
libraries. Things such as dumping asm for specific function/target pairs
for debugging, maybe a world of other things I've not thought about. Making
plugins to opt have access to more parts of LLVM seems strictly better the
more I think about it -- this has essentially no cost to the LLVM-side
layering, and lets folks experiment with more and different things.

-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140527/f8cae0ef/attachment.html>


More information about the llvm-commits mailing list