[PATCH] D108741: [GlobalDCE] Handle non-vfunc entries in vtables during VFE

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 15:57:42 PDT 2021


kubamracek added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/GlobalDCE.cpp:133
+
+  for (MDNode *Type : Types) {
+    uint64_t Offset =
----------------
fhahn wrote:
> It seems like  it may be quite expensive to iterate over all types for a global, getting the pointer at the offsets and so on, possibly multiple times for the same GV. If that's the case, could we pre-compute the set of valid pointers in `VTable` and then just check against the set?
Done.


================
Comment at: llvm/test/Transforms/GlobalDCE/virtual-functions-non-vfunc-entries.ll:1
+; RUN: opt < %s -globaldce -S | FileCheck %s
+
----------------
fhahn wrote:
> Can you pre-commit this test and just include the diff with the changes caused by the patch?
Done.


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

https://reviews.llvm.org/D108741



More information about the llvm-commits mailing list