[PATCH] D104598: [NFCI-ish][SimplifyCFGPass] Rework and generalize `ret` block tail-merging

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 14:15:41 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:128-132
+      BasicBlock::iterator I(Term);
       --I;
       // Skip over debug info.
       while (isa<DbgInfoIntrinsic>(I) && I != BB.begin())
         --I;
----------------
rnk wrote:
> Can this be `Term->getPrevNonDebugInstruction`?
I'd rather not change existing code just because we can, this code goes away in the very next patch.


================
Comment at: llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp:149
+    BasicBlock *CanonicalBB = nullptr;
+    SmallVector<PHINode *, 1> Ops;
+
----------------
rnk wrote:
> Maybe `Phis` is a better name?
How about `NewOps`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104598



More information about the llvm-commits mailing list