From 2d818c4fd9069a58482f581d156564f2506d018b Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Sun, 28 Feb 2021 09:01:26 -0800 Subject: [PATCH] Use mlir::OpState::operator->() to get to methods of mlir::Operation. This is a preparation step to remove those methods from OpState. PiperOrigin-RevId: 360043992 --- lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc b/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc index 4be9b65..6164185 100644 --- a/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc +++ b/lib/Dialect/mhlo/transforms/transform_unranked_hlo.cc @@ -126,7 +126,7 @@ struct ElementwiseOpConversion : public OpRewritePattern { Type flatResultTy = RankedTensorType::get({ShapedType::kDynamicSize}, resultElementTy); Value flatResult = - rewriter.create(loc, flatResultTy, flatOperands, op.getAttrs()); + rewriter.create(loc, flatResultTy, flatOperands, op->getAttrs()); // Restore original shape. rewriter.replaceOpWithNewOp(op, op.getType(), @@ -192,7 +192,7 @@ struct ConvertUnrankedScalarDynamicBroadcastBinaryOp rhs_is_scalar ? rhs : reshaped}; Value computed = rewriter.create( loc, TypeRange{RankedTensorType::get({-1}, result_element_type)}, - new_operands, op.getAttrs()); + new_operands, op->getAttrs()); // Reshape the result back into an unranked tensor. rewriter.replaceOpWithNewOp(op, result_type, @@ -278,7 +278,7 @@ struct ConvertUnrankedDynamicBroadcastOpHelper { auto result_type = RankedTensorType::get(dynamic_dimensions, result_element_type); Value result = if_builder.create( - loc, ArrayRef{result_type}, reshaped_operands, op.getAttrs()); + loc, ArrayRef{result_type}, reshaped_operands, op->getAttrs()); Value reshaped_result = if_builder.create( loc, UnrankedTensorType::get(result_element_type), result); if_builder.create(loc, reshaped_result); @@ -386,7 +386,7 @@ struct ConvertUnrankedDynamicBroadcastBinaryOp loc, RankedTensorType::get({}, lhs_type.getElementType()), lhs); Value if_lhs_scalar_result = if_lhs_scalar_builder.create( loc, ArrayRef{result_type}, ArrayRef{reshaped_lhs, rhs}, - op.getAttrs()); + op->getAttrs()); Value extended_if_lhs_scalar_result = extendToBroadcastShape(if_lhs_scalar_builder, loc, if_lhs_scalar_result, shape_of_lhs, shape_of_rhs); @@ -409,7 +409,7 @@ struct ConvertUnrankedDynamicBroadcastBinaryOp loc, RankedTensorType::get({}, rhs_type.getElementType()), rhs); Value if_rhs_scalar_result = if_rhs_scalar_builder.create( loc, ArrayRef{result_type}, ArrayRef{lhs, reshaped_rhs}, - op.getAttrs()); + op->getAttrs()); Value extended_if_rhs_scalar_result = extendToBroadcastShape(if_rhs_scalar_builder, loc, if_rhs_scalar_result, shape_of_lhs, shape_of_rhs);