[PATCH] D101836: [LoopVectorize] Enable strict reductions when allowReordering() returns false
Kerry McLaughlin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 5 07:50:56 PDT 2021
kmclaughlin added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9660
+
+ return (all_of(LVL.getReductionVars(), [&](auto &Reduction) -> bool {
+ RecurrenceDescriptor RdxDesc = Reduction.second;
----------------
david-arm wrote:
> sdesmalen wrote:
> > Why do all of the reductions have to be ordered for the LV to be able to vectorize FP math?
> > (e.g. if there is an integer reduction and an ordered FP reduction, it would now choose not to vectorize based on this condition)
> I guess it might be worth adding a test for this too then, i.e. having a loop with both an integer and FP reduction and ensure we vectorise with ordered reductions.
Hi @sdesmalen, we should only need the FP reductions in the loop to be ordered. I've changed this so that only reductions where `hasExactFPMath()` is true need to be ordered & added a test for this scenario to strict-fadd.ll
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101836/new/
https://reviews.llvm.org/D101836
More information about the llvm-commits
mailing list