This is an archive of the discontinued LLVM Phabricator instance.

[LV] Disable epilogue vectorization for scalable VFs
ClosedPublic

Authored by c-rhodes on Dec 10 2020, 1:06 PM.

Details

Summary

Epilogue vectorization doesn't support scalable vectorization factors
yet, disable it for now.

Diff Detail

Event Timeline

c-rhodes created this revision.Dec 10 2020, 1:06 PM
c-rhodes requested review of this revision.Dec 10 2020, 1:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 1:06 PM
bmahjour added inline comments.Dec 10 2020, 1:23 PM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
5778

We can just return Result around line 5792 (please see suggestion below), then we don't need to change the check near line 9209.

5787–5796
// FIXME: This can be fixed for scalable vectors later, because at this stage
// the LoopVectorizer will only consider vectorizing a loop with scalable
// vectors when the loop has a hint to enable vectorization for a given VF.
if (MainLoopVF.isScalable()) {
  LLVM_DEBUG(dbgs() << "LEV: Epilogue vectorization for scalable vectors not yet supported.\n");
  return Result;
}
9215

please see comment above.

c-rhodes updated this revision to Diff 311186.Dec 11 2020, 5:32 AM

Address comments and added test.

c-rhodes marked an inline comment as done.Dec 11 2020, 5:33 AM
c-rhodes added inline comments.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
5778

We can just return Result around line 5792 (please see suggestion below), then we don't need to change the check near line 9209.

That makes more sense, cheers. Added a simple test as well.

sdesmalen accepted this revision.Dec 11 2020, 8:20 AM

LGTM

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
5778

I guess there is no reason why the tail can't still be vectorized with a fixed-width VF, but given the state of scalable loop-vec I don't think that is really something to worry about at this point.

This revision is now accepted and ready to land.Dec 11 2020, 8:20 AM
This revision was automatically updated to reflect the committed changes.
c-rhodes marked an inline comment as done.