This is an archive of the discontinued LLVM Phabricator instance.

[ValueTypes] Add EVT::isFixedLengthVector
ClosedPublic

Authored by c-rhodes on Mar 18 2020, 11:39 AM.

Details

Summary

Related to D75672, this patch adds EVT::isFixedLengthVector to determine
if the underlying vector type is of fixed length.

An assert is introduced in EVT::getVectorNumElements that triggers for
types that aren't fixed length. This is currently guarded by a flag
added D75297 that is off by default and has been renamed to the more
generic ENABLE_STRICT_FIXED_SIZE_VECTORS.

Ideally we want to get rid of getVectorNumElements but a quick grep
shows there are >350 uses in lib/CodeGen and 75 in lib/Target/AArch64
alone. All of these probably aren't EVT::getVectorNumElements (some may
be the MVT equivalent), but there are many places to fixup and having
the assert on by default would make the SVE upstreaming effort
difficult.

Diff Detail

Event Timeline

c-rhodes created this revision.Mar 18 2020, 11:39 AM
This revision is now accepted and ready to land.Mar 18 2020, 12:32 PM
This revision was automatically updated to reflect the committed changes.