[PATCH] D110235: [LoopVectorize] Support reductions that store intermediary result

Igor Kirillov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 13:29:58 PST 2022


igor.kirillov added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9335
+      // is no need to create a recipe for them.
+      StoreInst *SI;
+      if ((SI = dyn_cast<StoreInst>(&I)) &&
----------------
igor.kirillov wrote:
> fhahn wrote:
> > I think it would also be good to include at least some information in the VPlan that the store is handled as part of the reduction. Perhaps `VPReductionRecipe` should print if the result is stored after the loop? Please add a test case to `vplan-printing.ll`
> I'm not sure how to display this information properly. This is how output of `VReductionRecipe::print` looks like now:
> 
>  REDUCE ir<%red.next> = ir<%red> + fast reduce.fadd (ir<%lv>)
> 
> I could add something to the end but it doesn't seem to fit there. Also I have not found any proper `V.*Recipe` where I could place something like `DELETE store .*`. 
@fhahn I added some info to VReductionRecipe::print and a relevant test. What do you think about it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110235



More information about the llvm-commits mailing list