[PATCH] D107645: [GlobalDCE] Handle relative pointers in VFE (for Swift vtables)

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 27 17:26:21 PDT 2021


kubamracek added inline comments.


================
Comment at: llvm/lib/Analysis/TypeMetadataUtils.cpp:196
+      if (Operand1TargetGlobal != TopLevelGlobal)
+        return nullptr;
+
----------------
fhahn wrote:
> kubamracek wrote:
> > fhahn wrote:
> > > Could you also add a test case for that?
> > That's tough without <https://reviews.llvm.org/D108741>, because returning "not found" from this function is currently going to make GlobalDCE be *more aggressive* and remove that slot from the vtable. Writing a test for this behavior is... "weird" because that behavior sounds like a bug (to be fixed with <https://reviews.llvm.org/D108741>).
> It would still provide coverage for that code path.
Good point. I have added a test for that, and I'll fix the test with the subsequent change to test for the expected behavior.


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

https://reviews.llvm.org/D107645



More information about the llvm-commits mailing list