From: Amanda Tang Date: Tue, 18 Jul 2023 20:34:08 +0000 (+0000) Subject: [ODS] Quick fix X-Git-Tag: upstream/17.0.6~1273 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=729ffb5cdf3ee09e8e89cdd122084a9563ee0717;p=platform%2Fupstream%2Fllvm.git [ODS] Quick fix Quick fix for a failing test in https://reviews.llvm.org/rG5267ed05bc4612e91409d63b4dbc4e01751acb75 Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D155637 --- diff --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp index a06dd44..1c52992 100644 --- a/mlir/lib/Dialect/Shape/IR/Shape.cpp +++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp @@ -918,14 +918,12 @@ LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes( MLIRContext *context, std::optional location, ConstShapeOp::Adaptor adaptor, SmallVectorImpl &inferredReturnTypes) { Builder b(context); - const Properties *prop = &adaptor.getProperties(); + const Properties prop = adaptor.getProperties(); DenseIntElementsAttr shape; // TODO: this is only exercised by the Python bindings codepath which does not // support properties - if (prop) - shape = prop->shape; - else - shape = adaptor.getAttributes().getAs("shape"); + shape = prop.shape ? prop.shape : + adaptor.getAttributes().getAs("shape"); if (!shape) return emitOptionalError(location, "missing shape attribute"); inferredReturnTypes.assign({RankedTensorType::get(