From e095f9e72adfb6edb881212639e8eedb3206991b Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Fri, 17 May 2019 15:23:44 -0700 Subject: [PATCH] Also visit memref element type in AsmPrinter -- PiperOrigin-RevId: 248797935 --- mlir/lib/IR/AsmPrinter.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index f99c09f..73c74e7 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -197,12 +197,17 @@ void ModuleState::visitType(Type type) { visitType(input); for (auto result : funcType.getResults()) visitType(result); - } else if (auto memref = type.dyn_cast()) { + return; + } + if (auto memref = type.dyn_cast()) { // Visit affine maps in memref type. for (auto map : memref.getAffineMaps()) recordAttributeReference(AffineMapAttr::get(map)); - } else if (auto vecOrTensor = type.dyn_cast()) { - visitType(vecOrTensor.getElementType()); + // TODO(b/132735995) Remove this when MemRef is a subclass of ShapedType. + visitType(memref.getElementType()); + } + if (auto shapedType = type.dyn_cast()) { + visitType(shapedType.getElementType()); } } -- 2.7.4