8230062: assert(i == p->size()-1) failed: must be last element of the pack

Avoids vectorization of reduction chain in which an intermediate result is used.

Reviewed-by: roland, thartmann
This commit is contained in:
Christian Hagedorn 2019-09-30 09:29:10 +02:00
parent 03c764c5e3
commit 08f652aa51

View File

@ -2045,12 +2045,11 @@ bool SuperWord::profitable(Node_List* p) {
for (uint k = 0; k < use->req(); k++) {
Node* n = use->in(k);
if (def == n) {
// reductions should only have a Phi use at the the loop
// head and out of loop uses
// Reductions should only have a Phi use at the loop head or a non-phi use
// outside of the loop if it is the last element of the pack (e.g. SafePoint).
if (def->is_reduction() &&
((use->is_Phi() && use->in(0) == _lpt->_head) ||
!_lpt->is_member(_phase->get_loop(_phase->ctrl_or_self(use))))) {
assert(i == p->size()-1, "must be last element of the pack");
(!_lpt->is_member(_phase->get_loop(_phase->ctrl_or_self(use))) && i == p->size()-1))) {
continue;
}
if (!is_vector_use(use, k)) {