aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/VectorToLLVM
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-07-21 22:28:45 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-07-21 22:28:59 +0000
commit5a8a159bf5279455b4688f80a6864ca8f37f4b4e (patch)
tree3c91363f5d30e73c02f773a5bff5fc84f0c8a3ca /mlir/lib/Conversion/VectorToLLVM
parentc54c76037b9d7e611fc3c2955b2b9a7934fbb957 (diff)
Add verifier for insert/extract element/value on type match between container and inserted/extracted value, and fix vector.shuffle lowering
Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D106398
Diffstat (limited to 'mlir/lib/Conversion/VectorToLLVM')
-rw-r--r--mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
index 53ce5ca3d452..3b474113b51e 100644
--- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
+++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
@@ -541,6 +541,12 @@ public:
}
// For all other cases, insert the individual values individually.
+ Type eltType;
+ llvm::errs() << llvmType << "\n";
+ if (auto arrayType = llvmType.dyn_cast<LLVM::LLVMArrayType>())
+ eltType = arrayType.getElementType();
+ else
+ eltType = llvmType.cast<VectorType>().getElementType();
Value insert = rewriter.create<LLVM::UndefOp>(loc, llvmType);
int64_t insPos = 0;
for (auto en : llvm::enumerate(maskArrayAttr)) {
@@ -551,7 +557,7 @@ public:
value = adaptor.v2();
}
Value extract = extractOne(rewriter, *getTypeConverter(), loc, value,
- llvmType, rank, extPos);
+ eltType, rank, extPos);
insert = insertOne(rewriter, *getTypeConverter(), loc, insert, extract,
llvmType, rank, insPos++);
}