We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ffc2a4 commit bc3f5aeCopy full SHA for bc3f5ae
mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
@@ -221,7 +221,9 @@ class FtoICastOpConversion : public OpConversionPattern<CastOp> {
221
if (!dstType)
222
return rewriter.notifyMatchFailure(castOp, "type conversion failed");
223
224
- if (!emitc::isSupportedIntegerType(dstType))
+ // Float-to-bool casts are not supported: any non-zero value must be mapped
225
+ // to true, which does not hold with rounding for values <= 0.5.
226
+ if (!emitc::isSupportedIntegerType(dstType) || dstType.isInteger(1))
227
return rewriter.notifyMatchFailure(castOp,
228
"unsupported cast destination type");
229
0 commit comments