[PATCH] D103181: [SimplifyCFG] Use make_early_inc_range() while deleting instructions

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 11:41:22 PDT 2021


aheejin marked an inline comment as done.
aheejin added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:4503
     Instruction *InsertPt = DestEHPad;
-    for (PHINode &PN : BB->phis()) {
-      // The iterator must be incremented here because the instructions are
-      // being moved to another block.
+    for (PHINode &PN : llvm::make_early_inc_range(BB->phis())) {
       if (PN.use_empty() || !PN.isUsedOutsideOfBlock(BB))
----------------
lebedev.ri wrote:
> Is `llvm::` really needed?
No it isn't. Thanks; removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103181



More information about the llvm-commits mailing list