[Mlir-commits] [mlir] [mlir][tosa] Avoid introducing int <-> float casts (PR #195882)
Luke Hutton
llvmlistbot at llvm.org
Wed May 6 03:16:37 PDT 2026
================
@@ -941,6 +941,13 @@ struct NonNarrowingCastsOptimization : public OpRewritePattern<tosa::CastOp> {
"legal in TOSA");
}
+ if (innerInputType.getElementType().isInteger() !=
+ outerOutputType.getElementType().isInteger()) {
+ return rewriter.notifyMatchFailure(
+ castOp, "integer to float and float to integer casts are not "
+ "supported to avoid introducing illegal type combinations");
+ }
----------------
lhutton1 wrote:
Ah yes, these are annoying cases
https://github.com/llvm/llvm-project/pull/195882
More information about the Mlir-commits
mailing list