diff options
| author | Alex Zinenko <zinenko@google.com> | 2019-12-17 11:38:53 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-17 11:43:59 -0800 |
| commit | 0bdc72d2df87aec68d7a1920026bcc37422a823b (patch) | |
| tree | e372fa7667d697dd0d6ff04c1babb792570a1f6d | |
| parent | 651eaa03e8cda04ffcec846d9b84f310aaeeda6e (diff) | |
| download | bcm5719-llvm-0bdc72d2df87aec68d7a1920026bcc37422a823b.tar.gz bcm5719-llvm-0bdc72d2df87aec68d7a1920026bcc37422a823b.zip | |
StdToLLVM conversion: drop getMemRefElementType utility function
This function has become redundant with MemRefDescriptor::getElementType and is
no longer necessary. Use the MemRefDescriptor pervasively to concentrate
descriptor-related logic in one place and drop the utility function.
PiperOrigin-RevId: 286024168
| -rw-r--r-- | mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp index fa6512010c8..9b2113ac7aa 100644 --- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp @@ -253,17 +253,6 @@ Type LLVMTypeConverter::convertStandardType(Type type) { return {}; } -// Convert the element type of the memref `t` to to an LLVM type using -// `lowering`, get a pointer LLVM type pointing to the converted `t`, wrap it -// into the MLIR LLVM dialect type and return. -static Type getMemRefElementPtrType(MemRefType t, LLVMTypeConverter &lowering) { - auto elementType = t.getElementType(); - auto converted = lowering.convertType(elementType); - if (!converted) - return {}; - return converted.cast<LLVM::LLVMType>().getPointerTo(t.getMemorySpace()); -} - LLVMOpLowering::LLVMOpLowering(StringRef rootOpName, MLIRContext *context, LLVMTypeConverter &lowering_, PatternBenefit benefit) @@ -1429,7 +1418,7 @@ struct LoadStoreOpLowering : public LLVMLegalizationPattern<Derived> { ArrayRef<Value *> indices, ConversionPatternRewriter &rewriter, llvm::Module &module) const { - auto ptrType = getMemRefElementPtrType(type, this->lowering); + LLVM::LLVMType ptrType = MemRefDescriptor(memRefDesc).getElementType(); int64_t offset; SmallVector<int64_t, 4> strides; auto successStrides = getStridesAndOffset(type, strides, offset); |

