[mlir] add support for index type in vectors.

The patch enables the use of index type in vectors. It is a prerequisite to support vectorization for indexed Linalg operations. This refactoring became possible due to the newly introduced data layout infrastructure. The data layout of a module defines the bitwidth of the index type needed to verify bitcasts and similar vector operations.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D99948
This commit is contained in:
Tobias Gysi committed 2021-04-08 08:17:13 +00:00
1 parent 20105b6b48
commit b614ada0e8
20 files changed
+457 -79

No files matched your search

@@ -163,13 +163,13 @@ replaceTransferOpWithMasked(ConversionPatternRewriter &rewriter,
LLVMTypeConverter &typeConverter, Location loc,
TransferReadOp xferOp, ArrayRef<Value> operands,
Value dataPtr, Value mask) {
VectorType fillType = xferOp.getVectorType();
Value fill = rewriter.create<SplatOp>(loc, fillType, xferOp.padding());
Type vecTy = typeConverter.convertType(xferOp.getVectorType());
if (!vecTy)
return failure();
auto adaptor = TransferReadOpAdaptor(operands, xferOp->getAttrDictionary());
Value fill = rewriter.create<SplatOp>(loc, vecTy, adaptor.padding());
unsigned align;
if (failed(getMemRefAlignment(
typeConverter, xferOp.getShapedType().cast<MemRefType>(), align)))