This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Don't consider scalable vector types in SLPVectorizerPass::vectorizeChainsInBlock
ClosedPublic

Authored by david-arm on Jul 10 2020, 3:31 AM.

Details

Summary

In vectorizeChainsInBlock we try to collect chains of PHI nodes
that have the same element type, but the code is relying upon
the implicit conversion from TypeSize -> uint64_t. For now, I have
modified the code to ignore PHI nodes with scalable types.

Diff Detail

Event Timeline

david-arm created this revision.Jul 10 2020, 3:31 AM
sdesmalen added inline comments.Jul 13 2020, 6:23 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7405

Should the check for scalable (+ corresponding code to bail out) be hoisted out of the if (EltTy->isSized()) condition/block?

david-arm marked an inline comment as done.Jul 13 2020, 11:58 PM
david-arm added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7405

I'm not sure really. This change fixes the case I was interested, but not sure what it means if a type is not sized *and* scalable? I assumed that if a type wasn't sized then you couldn't call getTypeSizeInBits and hope to get a sensible answer. We only know if the type is scalable or not by asking for the TypeSize.

david-arm marked 2 inline comments as done.Jul 27 2020, 1:50 AM
david-arm added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7405

Any further thoughts on this @sdesmalen ? If it's not sized then I can't ask the question if it's scalable or not.

efriedma added inline comments.Jul 27 2020, 12:18 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7405

The isSized() check here is nonsense: an instruction can't have an unsized result or operand type.

david-arm updated this revision to Diff 281206.Jul 28 2020, 5:59 AM
david-arm marked an inline comment as done.Jul 28 2020, 9:17 AM

Hi @efriedma I tried removing the isSized() check and added an assert instead. I tested it and none of our tests broke! Or would you prefer me to just remove the assert completely?

efriedma accepted this revision.Jul 28 2020, 10:57 AM

LGTM

The assertion is probably a little excessive, but someone thought it was worth checking for at some point, so it's okay.

This revision is now accepted and ready to land.Jul 28 2020, 10:57 AM