[PATCH] D54223: [SimpleLoopUnswitch] adding cost multiplier to cap exponential unswitch with

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 22:55:19 PST 2018


fedor.sergeev added inline comments.


================
Comment at: lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:2303
+      (isGuard(&TI) ||
+       1 >= llvm::count_if(successors(&TI), [&L](BasicBlock *SuccBB) {
+         return L.contains(SuccBB);
----------------
chandlerc wrote:
> I think the yoda-comparison makes this harder to read. I'd rather say `count_if(...) <= 1`.
Specifically wanted to try this and check how people react. :)
I find both variants somewhat uneasy to glance over.
Standard one because of the multi-line nature of a lambda and many closing brackets/parens :(


Repository:
  rL LLVM

https://reviews.llvm.org/D54223





More information about the llvm-commits mailing list