[PATCH] D130173: [Matrix] Add assert to extractVector with undef values
Francis Visoiu Mistrih via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 20 07:53:08 PDT 2022
thegameg updated this revision to Diff 446155.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130173/new/
https://reviews.llvm.org/D130173
Files:
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
Index: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -338,6 +338,9 @@
Value *extractVector(unsigned I, unsigned J, unsigned NumElts,
IRBuilder<> &Builder) const {
Value *Vec = isColumnMajor() ? getColumn(J) : getRow(I);
+ assert(cast<FixedVectorType>(Vec->getType())->getNumElements() >=
+ NumElts &&
+ "Extracted vector will contain undef values");
return Builder.CreateShuffleVector(
Vec, createSequentialMask(isColumnMajor() ? I : J, NumElts, 0),
"block");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130173.446155.patch
Type: text/x-patch
Size: 752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220720/1efcf996/attachment.bin>
More information about the llvm-commits
mailing list