[Mlir-commits] [mlir] [MLIR][Math] add canonicalize-f32-promotion pass (PR #92482)
Zhennan Qin
llvmlistbot at llvm.org
Wed May 22 17:27:04 PDT 2024
ZhennanQin 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
There will be passes other than `legalize-to-f32` and `emulate-unsupported-floats` that can insert extf and truncf ops. Take `matmul_bf16 + bias_add_bf16` as example, because we want to use fp32 as the accumulator data type, so in matmul lowering pass, matmul_bf16 will be replaced with scf.for with `x86vector.avx.intr.dot + truncf`. Then in `legalize-to-f32` pass, `bias_add_bf16` will be replaced with with `extf + bias_add_fp32 + truncf`, and we will want to eliminate the extf / truncf pairs between `x86vector.avx.intr.dot` and `bias_add_fp32`.
https://github.com/llvm/llvm-project/pull/92482
More information about the Mlir-commits
mailing list