This is an archive of the discontinued LLVM Phabricator instance.

[SLPVectorizer][SVE] Skip scalable-vector instructions before vectorizeSimpleInstructions.
ClosedPublic

Authored by huihuiz on Sep 11 2020, 3:32 PM.

Details

Summary

For scalable type, the aggregated size is unknown at compile-time.
Skip instructions with scalable type to ensure the list of instructions
for vectorizeSimpleInstructions does not contains any scalable-vector instructions.

Diff Detail

Unit TestsFailed

Event Timeline

huihuiz created this revision.Sep 11 2020, 3:32 PM
huihuiz requested review of this revision.Sep 11 2020, 3:32 PM
RKSimon added a subscriber: RKSimon.
RKSimon added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7085

(style)

// For scalable type, num of elements is unknown at compile-time.
if (auto *FVTy = dyn_cast<FixedVectorType>(IE->getType()))
  return FVTy->getNumElements();
return None;
sdesmalen added inline comments.Sep 14 2020, 10:11 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7079

I'm a bit concerned that this issue shows up so late in this pass. By the time it gets to this function, I believe we should be able to guarantee that the InsertElementInst is performed on a FixedVectorType. When vectorizeSimpleInstructions gets called, the list of Instructions should not contain any scalable-vector instructions.

huihuiz updated this revision to Diff 291673.Sep 14 2020, 1:54 PM
huihuiz marked an inline comment as done.
huihuiz retitled this revision from [SLPVectorizer][SVE] Avoid blind cast to FixedVectorType in getAggregateSize. to [SLPVectorizer][SVE] Skip scalable-vector instructions before vectorizeSimpleInstructions..
huihuiz edited the summary of this revision. (Show Details)

Thanks guys for the feedback!
Addressed review comments.

RKSimon accepted this revision.Sep 15 2020, 2:52 AM

LGTM

This revision is now accepted and ready to land.Sep 15 2020, 2:52 AM
This revision was landed with ongoing or failed builds.Sep 15 2020, 1:10 PM
This revision was automatically updated to reflect the committed changes.