[Mlir-commits] [mlir] [MLIR][Math] add canonicalize-f32-promotion pass (PR #92482)

Ivy Zhang llvmlistbot at llvm.org
Wed May 22 18:20:07 PDT 2024


crazydemo wrote:

> It's entirely possible that we should combine those two passes into one and put it ... I haven't the faintest idea where.
> 
> Maybe just move emulate-unsupported-floats into `math` and have it support both Arith and Math ... and then do the one stage change to avoid extra extf and truncf pairs

So we have `legalize-to-f32` and `emulate-unsupported-floats` to insert `extf/trunc` pairs for  `math` and `arith` respectively. All we need is a `removement of redundant  extf/trunc` pairs. We have two choices:
1. combining `legalize-to-f32` and `emulate-unsupported-floats` into one pass, and also do `removement` in this pass.
2. Create a independent pass, which only does `removement`. And this pass can be located in `Transforms` folder.

I think the second option meets our need and has smaller changes.

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


More information about the Mlir-commits mailing list