[PATCH] D81495: [SVE] Remove invalid calls to VectorType::getNumElements from BasicTTIImpl

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 12:40:51 PDT 2020


ctetreau created this revision.
Herald added subscribers: llvm-commits, psnobl, rkruppe, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.

Most of these operations are reasonable for scalable vectors. Due to
this, we have decided not to change the interface to specifically take
FixedVectorType despite the fact that the current implementations make
fixed width assumptions. Instead, we cast to FixedVectorType and assert
in the body. If a developer makes some change in the future that causes
one of these asserts to fire, they should either change their code or
make the function they are trying to call handle scalable vectors.

Add a helper FIXME_ScalableVectorNotSupported to handle the assert, cast
and "fixme comment". The name was picked such that it would be obvious
that it's a "FIXME cast" that should be fixed, and not a cast and assert
that has sound engineering behind it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81495

Files:
  llvm/include/llvm/CodeGen/BasicTTIImpl.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81495.269636.patch
Type: text/x-patch
Size: 12508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200609/b4756bfb/attachment.bin>


More information about the llvm-commits mailing list