[PATCH] D124910: [SCEV] Use umin_seq for BECount of multi-exit loops

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 03:58:30 PDT 2022


nikic added inline comments.


================
Comment at: llvm/test/Transforms/PhaseOrdering/AArch64/peel-multiple-unreachable-exits-for-vectorization.ll:42
+; CHECK-NEXT:    [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP4]], 5
+; CHECK-NEXT:    br i1 [[MIN_ITERS_CHECK]], label [[LOOP_PREHEADER21:%.*]], label [[VECTOR_PH:%.*]]
 ; CHECK:       vector.ph:
----------------
nikic wrote:
> I wonder whether we wouldn't be better off lowering `%x umin_seq %y` to `umin(%x, freeze %y)` rather than `%x == 0 ? 0 : umin(%x, %y)`. The latter is a more accurate representation (the former is a refinement), but it seems like in practice the former optimizes better. Especially if `%x == 0` folds in some way, we have a hard time recovering from that.
> 
> For example, here's the diff between this patch and a umin(freeze) lowering for this test file: https://gist.github.com/nikic/a61a04e3ddf52108be721434f8f2228c
I've put up https://reviews.llvm.org/D125372 to implement this. Ultimately I don't know how important this is either way.


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

https://reviews.llvm.org/D124910



More information about the llvm-commits mailing list