[PATCH] D109114: [GlobalDCE] In VFE, replace the whole 'sub' expression of unused relative-pointer-based vtable slots

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 12:37:22 PDT 2021


kubamracek added inline comments.


================
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()) {
----------------
fhahn wrote:
> kubamracek wrote:
> > fhahn wrote:
> > > it might be worth turning some of those checks into early continues instead, to reduce the nesting level.
> > Yes. Much better now :)
> I think you could also combine both checks `if (!PtrExpr || PtrExpr->getOpcode() !=...)` but that's a super tiny nit.
Fixed!


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

https://reviews.llvm.org/D109114



More information about the llvm-commits mailing list