Fold-tail currently supports reduction last-vector-value live-out's,
but has yet to support last-scalar-value live-outs, including
non-header phi's. As it relies on AllowedExit in order to detect
them and bail out we need to add the non-header PHI nodes to
AllowedExit, otherwise we end up with miscompiles.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Please update the comment about AllowedExit in LoopVectorizationLegality. Currently it only states that it holds reduction and induction vars, but it really contains any variable that can be accessed outside the loop.
Comment Actions
LGTM, thanks. Please wait with committing a day or so, in case Ayal has additional comments.
Comment Actions
This LGTM too; added a couple of minor comments about comments.
llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h | ||
---|---|---|
449 ↗ | (On Diff #218357) | |
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | ||
779 ↗ | (On Diff #218357) | While we're at it, the above comment deserves updating as well.. |
785 ↗ | (On Diff #218357) | (BTW, this SCEV-predicates condition, related to PR33706, should apply only to IV header-phi's and related instructions. But it's conservative; relaxing it calls for a separate optimization fix.) |
llvm/test/Transforms/LoopVectorize/lv-fold-tail-by-masking-bug.ll | ||
36 ↗ | (On Diff #218357) | Please retain the indication that these tests refer to "pr43166". (Such test files are often named pr43166.ll). |