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

Jakub Kuderski llvmlistbot at llvm.org
Wed May 29 19:22:27 PDT 2024


================
@@ -117,4 +117,50 @@ def ArithIntNarrowing : Pass<"arith-int-narrowing"> {
   ];
  }
 
+ def EliminateExplicitRounding : Pass<"eliminate-explicit-rounding"> {
+  let summary = "Eliminate the intermidiate truncf/extf pairs";
+  let description = [{
+    `legalize-to-f32` and `arith-emulate-unsupported-floats` pass does f32 promotion
+    for every op belonging to the illegal op list. Once there are some consecutive
+    illegal ops, these passes will insert `arith.truncf` and `arith.extf` pairs
+    between the illegal ops.
+    
+    This pass is to eliminate the intermediate truncf/extf pairs to improve
+    performance.
----------------
kuhar wrote:

Instead of this transformation pass, could we maintain a list of these extf-truncf pairs that cancel out and could be safely removed within these two passes?

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


More information about the Mlir-commits mailing list