[Mlir-commits] [mlir] 43ede0e - [mlir] Remove unused ConvertToLLVMPattern::linearizeSubscripts().
Christian Sigg
llvmlistbot at llvm.org
Tue Nov 17 08:25:55 PST 2020
Author: Christian Sigg
Date: 2020-11-17T17:25:45+01:00
New Revision: 43ede0e2a7fff54c450a0c2a698d02e197aa7b2a
URL: https://github.com/llvm/llvm-project/commit/43ede0e2a7fff54c450a0c2a698d02e197aa7b2a
DIFF: https://github.com/llvm/llvm-project/commit/43ede0e2a7fff54c450a0c2a698d02e197aa7b2a.diff
LOG: [mlir] Remove unused ConvertToLLVMPattern::linearizeSubscripts().
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D91594
Added:
Modified:
mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
index 04f884987fb7..14b413c994ab 100644
--- a/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
+++ b/mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
@@ -503,18 +503,6 @@ class ConvertToLLVMPattern : public ConversionPattern {
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<Value> indices,
- ArrayRef<Value> 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
index 3f75793a6383..67b0e243bfa4 100644
--- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
+++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
@@ -1041,23 +1041,6 @@ Value ConvertToLLVMPattern::createIndexConstant(
return createIndexAttrConstant(builder, loc, getIndexType(), value);
}
-Value ConvertToLLVMPattern::linearizeSubscripts(
- ConversionPatternRewriter &builder, Location loc, ArrayRef<Value> indices,
- ArrayRef<Value> 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<LLVM::MulOp>(
- loc, this->getIndexType(), ArrayRef<Value>{linearized, allocSizes[i]});
- linearized = builder.create<LLVM::AddOp>(
- loc, this->getIndexType(), ArrayRef<Value>{linearized, indices[i]});
- }
- return linearized;
-}
-
Value ConvertToLLVMPattern::getStridedElementPtr(
Location loc, Type elementTypePtr, Value descriptor, ValueRange indices,
ArrayRef<int64_t> strides, int64_t offset,
More information about the Mlir-commits
mailing list