[PATCH] D78210: [LV] Mark first-order recurrences as allowed exit
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 07:48:39 PDT 2020
fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp:671
SinkAfter, DT)) {
+ AllowedExit.insert(Phi);
FirstOrderRecurrences.insert(Phi);
----------------
nit: it seems a bit counter-intuitive to add to something called `AllowedExit` to reject loops with users of Phi outside the loop. There might be potential for re-naming/refactoring to make it clearer in future. In the meantime it might make sense to add a comment.
================
Comment at: llvm/test/Transforms/LoopVectorize/optsize.ll:129
+; CHECK-LABEL: @pr45526
+; CHECK-NOT: <
+;
----------------
This seems like a very subtle way to check vectorization is not happening. Given that the function is small, it might be better to check the IR for the whole function (or just the control-flow)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78210/new/
https://reviews.llvm.org/D78210
More information about the llvm-commits
mailing list