Skip to content
Merged
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@ class TruncFConversion : public OpConversionPattern<arith::TruncFOp> {
return rewriter.notifyMatchFailure(castOp,
"unsupported cast destination type");

if (!castOp.areCastCompatible(operandType, dstType))
if (!isa<emitc::OpaqueType>(dstType) &&
!isa<emitc::OpaqueType>(operandType) &&
!castOp.areCastCompatible(operandType, dstType))
return rewriter.notifyMatchFailure(castOp, "cast-incompatible types");

rewriter.replaceOpWithNewOp<emitc::CastOp>(castOp, dstType,
Expand Down Expand Up @@ -787,7 +789,9 @@ class ExtFConversion : public OpConversionPattern<arith::ExtFOp> {
return rewriter.notifyMatchFailure(castOp,
"unsupported cast destination type");

if (!castOp.areCastCompatible(operandType, dstType))
if (!isa<emitc::OpaqueType>(dstType) &&
!isa<emitc::OpaqueType>(operandType) &&
!castOp.areCastCompatible(operandType, dstType))
return rewriter.notifyMatchFailure(castOp, "cast-incompatible types");

rewriter.replaceOpWithNewOp<emitc::CastOp>(castOp, dstType,
Expand Down
Loading