[Mlir-commits] [mlir] [MLIR][Transforms] add eliminate-explicit-rounding pass (PR #93443)
Ivy Zhang
llvmlistbot at llvm.org
Mon May 27 01:16:46 PDT 2024
================
@@ -57,7 +57,9 @@ void mlir::math::populateLegalizeToF32TypeConverter(
});
typeConverter.addTargetMaterialization(
[](OpBuilder &b, Type target, ValueRange input, Location loc) {
- return b.create<arith::ExtFOp>(loc, target, input);
+ auto extFOp = b.create<arith::ExtFOp>(loc, target, input);
+ extFOp->setAttr("eliminatable", b.getBoolAttr(true));
----------------
crazydemo wrote:
> Does it matter which pass produced the `truncf / extf` pairs? I would start with a pass that eliminates all of them. You can add an optional lambda to rewrite pattern that users can set as a kind of "filter function".
It does not matter on my side, I would like to eliminate all of them as well. But we may need to include @krzysz00 into the discussion. BTW, do you have a PR right now?
https://github.com/llvm/llvm-project/pull/93443
More information about the Mlir-commits
mailing list