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

Jakub Kuderski llvmlistbot at llvm.org
Wed May 29 19:26:02 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:

What @krzysz00 suggested in https://github.com/llvm/llvm-project/pull/93443#issuecomment-2138154222 would be one implementation of what I had in mind here.

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


More information about the Mlir-commits mailing list