diff --git a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h --- a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h +++ b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h @@ -503,18 +503,6 @@ Value createIndexConstant(ConversionPatternRewriter &builder, Location loc, uint64_t value) const; - // Given subscript indices and array sizes in row-major order, - // i_n, i_{n-1}, ..., i_1 - // s_n, s_{n-1}, ..., s_1 - // obtain a value that corresponds to the linearized subscript - // \sum_k i_k * \prod_{j=1}^{k-1} s_j - // by accumulating the running linearized value. - // Note that `indices` and `allocSizes` are passed in the same order as they - // appear in load/store operations and memref type declarations. - Value linearizeSubscripts(ConversionPatternRewriter &builder, Location loc, - ArrayRef indices, - ArrayRef allocSizes) const; - // This is a strided getElementPtr variant that linearizes subscripts as: // `base_offset + index_0 * stride_0 + ... + index_n * stride_n`. Value getStridedElementPtr(Location loc, Type elementTypePtr, diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -1041,23 +1041,6 @@ return createIndexAttrConstant(builder, loc, getIndexType(), value); } -Value ConvertToLLVMPattern::linearizeSubscripts( - ConversionPatternRewriter &builder, Location loc, ArrayRef indices, - ArrayRef allocSizes) const { - assert(indices.size() == allocSizes.size() && - "mismatching number of indices and allocation sizes"); - assert(!indices.empty() && "cannot linearize a 0-dimensional access"); - - Value linearized = indices.front(); - for (int i = 1, nSizes = allocSizes.size(); i < nSizes; ++i) { - linearized = builder.create( - loc, this->getIndexType(), ArrayRef{linearized, allocSizes[i]}); - linearized = builder.create( - loc, this->getIndexType(), ArrayRef{linearized, indices[i]}); - } - return linearized; -} - Value ConvertToLLVMPattern::getStridedElementPtr( Location loc, Type elementTypePtr, Value descriptor, ValueRange indices, ArrayRef strides, int64_t offset,