[PATCH] D108741: [IR][GlobalDCE] Add ability to mark vtable methods as eligible for VFE and avoid eliminating non-eligible vfunc in VFE in GlobalDCE

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 08:48:55 PDT 2021


kubamracek added a comment.

> The only way around that that I can see is to break the assumption of a static offset. You will need to tie the load to its loadee more symbolically, like by saying that you are conceptually accessing Foo.bar and annotating the field in the global as only accessed through loads tagged Foo.bar.

Yes, that is exactly the idea. I'm going to tag the loads and the slots with a name of the base class and name of the method (actually it'll be the mangled name of the base method).

> That would get you a certain amount of the optimization, like when a virtual function is never used virtually in the program

This is exactly what I'm after, yes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108741/new/

https://reviews.llvm.org/D108741



More information about the llvm-commits mailing list