Change how globalopt handles aliases in llvm.used

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jun 7 12:53:25 PDT 2013


On 5 June 2013 20:08, Nick Lewycky <nlewycky at google.com> wrote:
> Does anyone else have an opinion on verify.patch? Is it okay to require in
> the verifier that every entry in @llvm.used must have a name? Is it ever
> valid for an optimization to nuke the name of a global without first
> checking whether it's used by @llvm.used?
>
> I'm convinced that having an unnamed variable in @llvm.used can't possibly
> have any use (it must be dead, we can ignore/remove all such entries), but
> I'm not sure whether a well-behaved optimization ever produces them (just as
> well-behaved optimizations may cause blocks to become unreachable).

The definition of llvm.used says it acts as an invisible external
reference, so I am pretty sure it is invalid to just remove the name
from an element.

> Review of verify.patch:
>
> Please also update LangRef.html with this patch to mention that all entries
> in @llvm.used must have names.

Done. New patch is attached.

> Good news, I think I've reviewed this patch before? It looks like it's
> probably ready to be submitted.

I uploaded it to http://llvm-reviews.chandlerc.com/D936 for a final OK.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify.patch
Type: application/octet-stream
Size: 2147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130607/8d0cb37a/attachment.obj>


More information about the llvm-commits mailing list