[PATCH] D80709: [SelectionDAG] Update getNode asserts for EXTRACT/INSERT_SUBVECTOR.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 05:57:25 PDT 2020


paulwalker-arm marked an inline comment as done.
paulwalker-arm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5454
+           "Cannot extract a scalable vector from a fixed length vector!");
+    assert((VT.isScalableVector() != N1VT.isScalableVector() ||
+            VT.getVectorMinNumElements() <= N1VT.getVectorMinNumElements()) &&
----------------
david-arm wrote:
> This suggests we permit fixed width vectors of arbitrary length being extracted as subvectors from a scalable vector. That's ok, but presumably we'll need to support that in the backend too with appropriate undefs being used to fill in the parts that exceed the bounds of the scalable vector.
Yes and no.  We do permit the extraction of an arbitrary length fixed length vector from a scalable vector but the requirement that the extracted vector must be smaller than the source vector stands. As does the requirement for there to be no overflow. It's just that we cannot protect against those invalid use cases with a compiler time assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80709/new/

https://reviews.llvm.org/D80709





More information about the llvm-commits mailing list