[PATCH] D109114: [GlobalDCE] In VFE, replace the whole 'sub' expression of unused relative-pointer-based vtable slots
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 4 11:08:58 PDT 2021
fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
================
Comment at: llvm/include/llvm/Analysis/TypeMetadataUtils.h:80
+
+// Finds the same "relative pointer" pattern as described above, where the
+// target is `F`, and replaces the entire pattern with a constant zero.
----------------
shouldn't this be `///`?
================
Comment at: llvm/lib/Analysis/TypeMetadataUtils.cpp:204
+ if (auto *PtrExpr = dyn_cast<ConstantExpr>(U)) {
+ if (PtrExpr->getOpcode() == Instruction::PtrToInt) {
+ for (auto *PtrToIntUser : PtrExpr->users()) {
----------------
it might be worth turning some of those checks into early continues instead, to reduce the nesting level.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109114/new/
https://reviews.llvm.org/D109114
More information about the llvm-commits
mailing list