[PATCH] D108741: [IR][GlobalDCE] Extend !vcall_visibility to be able to specify an offset range that it applies to

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 09:04:28 PDT 2021


fhahn accepted this revision.
fhahn added a comment.

This approach LGTM and I think it should address the original concerns raised by @pcc.

Please wait with committing until next week, in case @pcc has additional concerns about the new approach.



================
Comment at: llvm/lib/IR/Verifier.cpp:757
+    auto Op0Int = cast<ConstantInt>(Op0Val)->getValue();
+    Assert(Op0Int.uge(0) && Op0Int.ult(std::numeric_limits<uint64_t>::max()),
+           "bad !vcall_visibility attachment");
----------------
thanks for adding the verifier! It would be good to have a couple of tests for it too


================
Comment at: llvm/lib/Transforms/IPO/GlobalDCE.cpp:237
       GlobalObject::VCallVisibility TypeVis = GO->getVCallVisibility();
+      auto Range = GO->getVTableOffsetRange();
       if (TypeVis == GlobalObject::VCallVisibilityTranslationUnit ||
----------------
nit: sink inside if?


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

https://reviews.llvm.org/D108741



More information about the llvm-commits mailing list