[patch] Teach GlobalDCE how to remove empty global_ctor entries

Nico Weber thakis at chromium.org
Fri May 2 11:43:39 PDT 2014


On Fri, May 2, 2014 at 11:05 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>>> This is a case where an integration test might be a good idea.  Do you
>>> have a reasonably size test where this change causes a ctor to  be
>>> deleted at -O2? We might want to test that, so that even if we go with
>>> a different optimization strategy in the future we still have a test
>>> of the end result (the ctor gets deleted somewhere in -O2).
>>
>> Yes, there's one in the bug. I can check that in on the clang side
>> once this patch is in.
>
> I was not thinking of *that* much integration, just a opt -O2 :-)
>
> Also on testing, can you add a test of the case where only some of the
> elements of llvm.global_ctors are removed? Make sure it includes a
> CHECK of the new content of global_ctor.

Both done, and landed in r207856, thanks!

> The patch LGTM with the extra testing. Richard, do you want to get
> llvm::function_ref in first or do it as followup patch?

That seems mostly unrelated. I'll change this code to use
llvm::function_ref once that lands. (function_ref looks useful to me,
but someone more versed in core llvm code should review it :-) )




More information about the llvm-commits mailing list