Skip to content

Commit

Permalink
Merge pull request #10487 from gita-omr/v0.22.0-release
Browse files Browse the repository at this point in the history
Disable AutoSIMD for problematic IV increment
  • Loading branch information
gita-omr committed Aug 28, 2020
2 parents 88c59f8 + b613b24 commit 53e0b10
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions runtime/compiler/optimizer/SPMDParallelizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,20 @@ bool TR_SPMDKernelParallelizer::visitTreeTopToSIMDize(TR::TreeTop *tt, TR_SPMDKe
int32_t pivStride = INVALID_STRIDE;
bool isAffine = isAffineAccess(comp, node->getFirstChild(), loop, piv, pivStride);

// if the induction variable is not incremented after the soon to be vectorized instructions, then we bail out (see: openj9/issues/9331)
if (isCheckMode)
{
if (!(tt->getNextTreeTop()->getNode()->getOpCode().isBooleanCompare() &&
tt->getNextTreeTop()->getNode()->getOpCode().isBranch() &&
hasPIV(tt->getNextTreeTop()->getNode(), piv)) ||
tt->getNextTreeTop()->getNextTreeTop()->getNode()->getOpCodeValue() != TR::BBEnd)
{
traceMsg(comp, " Induction variable may be incremented before vectorized operations, "
"this may cause functionally incorrect result. Vectorization not performed. see: openj9/issues/9331.\n");
return false;
}
}

// if this is transformation mode and this PIV is used by a vectorized expression and satisfies
// affine access conditions, duplicate the trees to create a vectorized loop increment
// for the vectorized version of the PIV
Expand Down

0 comments on commit 53e0b10

Please sign in to comment.