Skip to content

[mlir][tosa] Use typeConverter->convertType<T> #150578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ class MaxPool2dConverter : public OpConversionPattern<tosa::MaxPool2dOp> {

bool isUnsigned = op.getType().getElementType().isUnsignedInteger();
ShapedType resultTy =
cast<ShapedType>(getTypeConverter()->convertType(op.getType()));
getTypeConverter()->convertType<ShapedType>(op.getType());
if (!resultTy)
return rewriter.notifyMatchFailure(op, "failed to convert type");
Type resultETy = inputTy.getElementType();
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ class ReshapeConverter : public OpConversionPattern<tosa::ReshapeOp> {
matchAndRewrite(tosa::ReshapeOp reshape, OpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const final {
auto loc = reshape.getLoc();
auto resultType = cast_if_present<ShapedType>(
getTypeConverter()->convertType(reshape.getType()));
auto resultType =
getTypeConverter()->convertType<ShapedType>(reshape.getType());
if (!resultType) {
return rewriter.notifyMatchFailure(reshape.getLoc(),
"could not convert result type");
Expand Down