[PATCH] D134320: [llvm] Teach whole program devirtualization about relative vtables

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 14:54:53 PDT 2022


leonardchan created this revision.
leonardchan added reviewers: phosek, tejohnson.
leonardchan added a project: LLVM.
Herald added subscribers: ormris, hiraditya, Prazek.
Herald added a project: All.
leonardchan requested review of this revision.

Prior to this patch, WPD was not acting on relative-vtables in C++. This involves teaching WPD about two things:

- `llvm.load.relative` which is how relative-vtables are indexed (instead of GEP)
- `dso_local_equivalent` which is used in the vtable itself when taking the offset between a virtual function and vtable


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134320

Files:
  llvm/lib/Analysis/TypeMetadataUtils.cpp
  llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
  llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll
  llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl-check.ll
  llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl-multiple-assumes.ll
  llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll
  llvm/test/Transforms/WholeProgramDevirt/pointer-vtable.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134320.461720.patch
Type: text/x-patch
Size: 14045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/55e894c6/attachment.bin>


More information about the llvm-commits mailing list