[PATCH] D69830: [LoopPred/WC] Use a dominating widenable condition to remove analyze loop exits

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 05:48:59 PST 2019


fedor.sergeev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopPredication.cpp:1108
+    BasicBlock *ExitBB = BI->getSuccessor(ExitIfTrue ? 0 : 1);
+    if (!ExitBB->getTerminatingDeoptimizeCall())
+      // Profitability: indicator of rarely/never taken exit
----------------
ebrevnov wrote:
> Would it be better to check profitability in a more general way using BPI or similar?
Since widenable branch jumping to deoptimize is the main intended usecase for widenable branch itself
(we even show it in LangRef as a prime example of widenable.condition usage)
it seems to be a very good special case to start with.

BPI is tricky to use (and tricky to preserve), so it can not be the main source of truth for profitability purposes.



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

https://reviews.llvm.org/D69830





More information about the llvm-commits mailing list