[LLVMdev] Best way to clean up empty global_ctors

Nico Weber thakis at chromium.org
Thu May 1 11:23:13 PDT 2014


On Thu, May 1, 2014 at 11:19 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> Looking at GlobalOpt, it seems to do full symbolic evaluation of all
>> constructors, which is more than what's needed here. Just walking
>> llvm.global_ctors and removing calls to functions that are just "ret"
>> is all that's needed. Unless folks think that's a terrible idea, I'll
>> try to write a lightweight pass for doing just that.
>
> Not a bad idea, we just normally avoid small passes like that.

That's good to know, thanks. Is there a some kind of 'philosophical
overview' document for llvm's pass design somewhere that explains
things like this?

> Looking
> at -O2, looks like we run -globaldce really late, maybe this could be
> done in it?

I'll take a look, thanks!

>
> Cheers,
> Rafael




More information about the llvm-dev mailing list