1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[LV] Disable epilogue vectorization for non-latch exits

When skimming through old review discussion, I noticed a post commit comment on an earlier patch which had gone unaddressed.  Better late (4 months), than never right?

I'm not aware of an active problem with the combination of non-latch exits and epilogue vectorization, but the interaction was not considered and I'm not modivated to make epilogue vectorization work with early exits. If there were a bug in the interaction, it would be pretty hard to hit right now (as we canonicalize towards bottom tested loops), but an upcoming change to allow multiple exit loops will greatly increase the chance for error.  Thus, let's play it safe for now.
This commit is contained in:
Philip Reames 2021-07-06 10:49:13 -07:00
parent 2a3dbbb793
commit 394bad8809

View File

@ -6119,6 +6119,12 @@ bool LoopVectorizationCostModel::isCandidateForEpilogueVectorization(
}))
return false;
// Epilogue vectorization code has not been auditted to ensure it handles
// non-latch exits properly. It may be fine, but it needs auditted and
// tested.
if (L.getExitingBlock() != L.getLoopLatch())
return false;
return true;
}