[patch] Respect llvm.used in Internalize

Sean Silva silvas at purdue.edu
Fri Jul 19 16:22:47 PDT 2013


On Fri, Jul 19, 2013 at 1:41 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> On 19 July 2013 15:52, Sean Silva <silvas at purdue.edu> wrote:
> > + at llvm.compiler_used = appending global [1 x void ()*] [void ()* @g],
> > section "llvm.metadata"
> >
> > @llvm.compiler.used?
>
> duh, fixed.
>
> > +GlobalVariable *
> > +llvm::collectUsedGlobalVariables(const Module &M, const char *Name,
> > +                                 SmallPtrSet<GlobalValue *, 8> &Set) {
> >
> > (for a future patch). The return value seems kind of arbitrary; it seems
> to
> > be just to save a name lookup in the module. Maybe this function should
> take
> > a GlobalVariable * instead of a name? and leave it to the client to
> extract
> > the GlobalVariable* from the module? You could also then remove the
> `const
> > Module &M` parameter. Also, the function does something pretty specific,
> so
> > maybe it should have a more specific-sounding name.
>
> Doing the lookup also shares a bit of code for passes that need look
> at llvm.used and llvm.compiler.used. Maybe a better change would be to
> pass just a boolean instead of the name?
>

You probably know the right thing to do here better than I do. Mine was
just an "peephole" observation.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130719/4561503d/attachment.html>


More information about the llvm-commits mailing list