[PATCH] D116086: [InstCombine] Use range for loops (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 20 23:52:34 PST 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:194
   unsigned NumPhis = 0;
-  for (auto II = BB->begin(); II != BB->end(); II++, NumPhis++) {
+  for (Instruction &I : *BB) {
     // FIXME: consider handling this in AggressiveInstCombine
----------------
Iterating over `BB->phis()` would be more elegant here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116086



More information about the llvm-commits mailing list