[PATCH] D36783: [x86] Refactor the CMOV conversion pass to be more flexible.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 19:00:53 PDT 2017


chandlerc added a comment.

Thanks for the review, updated!



================
Comment at: lib/Target/X86/X86CmovConversion.cpp:169
+  SmallVector<MachineLoop *, 4> Loops(MLI.begin(), MLI.end());
+  for (int i = 0; i < (int)Loops.size(); ++i)
+    for (MachineLoop *Child : Loops[i]->getSubLoops())
----------------
aaboud wrote:
> You are calling "Loops.size()" every iteration intentionally, as you want to handle the just new added sub-loops.
> Do not you think we should comment on that, so nobody will optimize this by saving the initial "size()" once and check against it later?
Sure.


https://reviews.llvm.org/D36783





More information about the llvm-commits mailing list