[PATCH] D157861: LoopVectorize: vectorize finding first IV in select-cmp

Mel Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 03:10:00 PDT 2023


Mel-Chen added inline comments.
Herald added a subscriber: sunshaoce.


================
Comment at: llvm/include/llvm/Analysis/IVDescriptors.h:63-67
+  IFindFirstIV, ///< FindFirst reduction with select(icmp(),x,y) where one of
+                ///< (x,y) is decreasing loop induction PHI, and both x and y
+                ///< are integer type.
+  FFindFirstIV ///< FindFirst reduction with select(fcmp(),x,y) where one of
+               ///< (x,y) is decreasing loop induction PHI, and both x and y are
----------------
I prefer FindLastIncIV and FindLastDecIV. The term 'Last' should refer to the last iteration in the loop, and 'first' should refer to the first iteration in the loop.


================
Comment at: llvm/lib/Analysis/IVDescriptors.cpp:428-432
+         Kind == RecurKind::IFindLastIV || Kind == RecurKind::IFindFirstIV) &&
         (isa<ICmpInst>(Cur) || isa<SelectInst>(Cur)))
       ++NumCmpSelectPatternInst;
     if ((isFPMinMaxRecurrenceKind(Kind) || Kind == RecurKind::FAnyOf ||
+         Kind == RecurKind::FFindLastIV || Kind == RecurKind::FFindFirstIV) &&
----------------
I updated here. Please rebase on the last version. 


================
Comment at: llvm/lib/Analysis/IVDescriptors.cpp:620
 
+enum class LoopInductionVariable { None, Increasing, Decreasing };
+
----------------
How about name to LoopInductionDirection?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157861



More information about the llvm-commits mailing list