[LLVMdev] Best way to clean up empty global_ctors

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu May 1 11:19:13 PDT 2014


> 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. Looking
at -O2, looks like we run -globaldce really late, maybe this could be
done in it?

Cheers,
Rafael



More information about the llvm-dev mailing list