[PATCH] D75069: [LoopVectorizer] Inloop vector reductions

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 06:42:11 PDT 2020


gilr added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:238
   VPTransformState(unsigned VF, unsigned UF, LoopInfo *LI, DominatorTree *DT,
-                   IRBuilder<> &Builder, VectorizerValueMap &ValueMap,
-                   InnerLoopVectorizer *ILV, VPCallback &Callback)
-      : VF(VF), UF(UF), Instance(), LI(LI), DT(DT), Builder(Builder),
+                   const TargetTransformInfo *TTI, IRBuilder<> &Builder,
+                   VectorizerValueMap &ValueMap, InnerLoopVectorizer *ILV,
----------------
dmgreen wrote:
> Ayal wrote:
> > Too bad this requires passing TTI through the State everywhere.
> > Perhaps storing TTI in the recipe would be somewhat better.
> I've changed it to be stored there. It does mean multiple things are holding TTI. Let me know what you think.
It seems that TTI is only used later for deciding whether to use a shuffle sequence or an intrinsic based on data available during planning. If so, then it would be best if the Planner calls TTI->useReductionIntrinsic() and records that boolean decision in the Recipe. This is also required in order to estimate in-loop reduction cost. This could be done separately.


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

https://reviews.llvm.org/D75069





More information about the llvm-commits mailing list