[PATCH] D75500: StructurizeCFG: simplify phi nodes when possible

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 19:02:55 PST 2020


sameerds added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/StructurizeCFG.cpp:660
     Q.DT = DT;
-    for (size_t i = 0; i < InsertedPhis.size(); ++i) {
-      PHINode *Phi = InsertedPhis[i];
+    for (auto I : AffectedPhis) {
+      auto Phi = dyn_cast_or_null<PHINode>(I);
----------------
arsenm wrote:
> I think auto hurts readability here
Why is that? The next line immediately makes it clear that we are only instead if the "whatever I" is a PHINode. Also in general, how is this any different from say "for (auto BB : *F) { ... }" or "for (auto II : *BB) { ... }"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75500





More information about the llvm-commits mailing list