This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Mark VectorType::getNumElements() deprecated
AbandonedPublic

Authored by ctetreau on Aug 28 2020, 12:16 PM.

Details

Reviewers
efriedma
Summary

getNumElements() is being removed from base VectorType in
order to eliminate the class of bugs in which a scalable vector
is accidentally treated like a fixed length vector. Clients of
this function should either call getElementCount(), and handle
the case whre getElementCount().Min is true, or they can cast
to FixedVectorType and call getNumElements() if they are sure
that the vector has fixed width.

Deprecated VectorType functions will be removed after the LLVM 12 branch
point

See: http://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html

Diff Detail

Event Timeline

ctetreau created this revision.Aug 28 2020, 12:16 PM
Herald added a project: Restricted Project. · View Herald Transcript
ctetreau requested review of this revision.Aug 28 2020, 12:16 PM
ctetreau abandoned this revision.Aug 28 2020, 12:17 PM
ctetreau abandoned this revision.Aug 31 2020, 2:34 PM