[PATCH] D103814: [LoopVectorize] Don't use strict reductions when reordering is allowed

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 09:41:25 PDT 2021


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

Thanks @kmclaughlin, this looks like an important step towards being able to make `EnableStrictReductions` enabled by default in the future. This makes the behaviour compatible with the odd 'hint implies reordering' behaviour it had before, with or without the new -enable-strict-reductions flag.
So LGTM!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1307
 
+  bool useOrderedReductions(RecurrenceDescriptor &RdxDesc) {
+    return EnableStrictReductions && !Hints->allowReordering() &&
----------------
kmclaughlin wrote:
> sdesmalen wrote:
> > Is this interface in the CostModel necessary? It seems the one in InnerLoopVectorizer sufficient?
> Hi @sdesmalen, I think the interface in the CostModel is necessary for other places where useOrderedReductions is called that aren't changed by this patch, e.g. `LoopVectorizationCostModel::collectInLoopReductions()`
Ah that makes sense, thanks!


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

https://reviews.llvm.org/D103814



More information about the llvm-commits mailing list