diff --git a/mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp b/mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp --- a/mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp +++ b/mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp @@ -482,7 +482,8 @@ LLVM::LLVMPointerType elemPtrType) { Value offsetPtr = offsetBasePtr(builder, loc, typeConverter, memRefDescPtr, elemPtrType); - return builder.create(loc, offsetPtr); + return builder.create(loc, typeConverter.getIndexType(), + offsetPtr); } void UnrankedMemRefDescriptor::setOffset(OpBuilder &builder, Location loc,