[PATCH] D143465: [LoopVectorize] Vectorize the reduction pattern of integer min/max with index.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 23 14:44:09 PDT 2023


fhahn added inline comments.
Herald added a subscriber: hoy.


================
Comment at: llvm/lib/Analysis/IVDescriptors.cpp:741
+
+    auto LB = Loop::LoopBounds::getBounds(*Loop, *Phi, *SE);
+    if (!LB)
----------------
Using this API seems unnecessarily strict; we don't need to bounds (and getBounds may fail if It cannot identify the bounds), we just need to check the direction of the IV, which can be done by checking if it is an induction PHI and use ` SE.getMonotonicPredicateTyp`.


================
Comment at: llvm/test/Transforms/LoopVectorize/select-min-index.ll:264
 
 define i64 @test_not_vectorize_select_no_min_reduction(ptr %src) {
+; CHECK-VF4IC1-LABEL: @test_not_vectorize_select_no_min_reduction(
----------------
Is this incorrectly vectorized or does the test name need fixing? It looks like ` %min.val` isn't an actual minimum value phi?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143465



More information about the llvm-commits mailing list