Skip to content

Commit 729ffb5

Browse files
committed
[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
1 parent 48e93f5 commit 729ffb5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mlir/lib/Dialect/Shape/IR/Shape.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -918,14 +918,12 @@ LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes(
918918
MLIRContext *context, std::optional<Location> location,
919919
ConstShapeOp::Adaptor adaptor, SmallVectorImpl<Type> &inferredReturnTypes) {
920920
Builder b(context);
921-
const Properties *prop = &adaptor.getProperties();
921+
const Properties prop = adaptor.getProperties();
922922
DenseIntElementsAttr shape;
923923
// TODO: this is only exercised by the Python bindings codepath which does not
924924
// support properties
925-
if (prop)
926-
shape = prop->shape;
927-
else
928-
shape = adaptor.getAttributes().getAs<DenseIntElementsAttr>("shape");
925+
shape = prop.shape ? prop.shape :
926+
adaptor.getAttributes().getAs<DenseIntElementsAttr>("shape");
929927
if (!shape)
930928
return emitOptionalError(location, "missing shape attribute");
931929
inferredReturnTypes.assign({RankedTensorType::get(

0 commit comments

Comments
 (0)