This is an archive of the discontinued LLVM Phabricator instance.

[LV] Remove assert that VF cannot be scalable in setCostBasedWideningDecision.
ClosedPublic

Authored by sdesmalen on Jul 23 2021, 5:51 AM.

Details

Summary

Scalarization for scalable vectors is not (yet) supported, so the
LV discards a VF when scalarization is chosen as the widening
decision. It should therefore not assert that the VF is not scalable
when it computes the decision to scalarize.

The code can get here when both the interleave-cost, gather/scatter cost
and scalarization-cost are all illegal. This may e.g. happen for SVE
when the VF=1, to avoid generating <vscale x 1 x eltty> types that
the code-generator cannot yet handle.

Diff Detail

Event Timeline

sdesmalen created this revision.Jul 23 2021, 5:51 AM
sdesmalen requested review of this revision.Jul 23 2021, 5:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2021, 5:51 AM
sdesmalen updated this revision to Diff 361185.Jul 23 2021, 7:02 AM

Removed loop attribute from the test, because that actually caused the test to not actually test the code-change.

That's because it would always choose a VF=vscale x 4, and would therefore never try to compute a widening decision for VF=vscale x 1, which causes this issue.

david-arm accepted this revision.Jul 23 2021, 7:47 AM

LGTM!

llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll
132

nit: Can you use %[[IDX]] here instead of %index?

This revision is now accepted and ready to land.Jul 23 2021, 7:47 AM
This revision was landed with ongoing or failed builds.Jul 26 2021, 9:12 AM
This revision was automatically updated to reflect the committed changes.
sdesmalen marked an inline comment as done.Jul 26 2021, 9:13 AM