[Mlir-commits] [mlir] [MLIR][Transforms] add eliminate-explicit-rounding pass (PR #93443)

Matthias Gehre llvmlistbot at llvm.org
Mon May 27 01:08:17 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));
----------------
mgehre-amd wrote:

Why do you need to preserve `user-defined` trunc/extf pairs? I don't really see how they are different from the ones generated by the legalize-to-f32 pass.

https://github.com/llvm/llvm-project/pull/93443


More information about the Mlir-commits mailing list