[Mlir-commits] [mlir] [MLIR][Transforms] add eliminate-explicit-rounding pass (PR #93443)
Ivy Zhang
llvmlistbot at llvm.org
Wed May 29 21:41:33 PDT 2024
crazydemo wrote:
> This sounds contradictory to me. You said that the motivation it to ' eliminate the intermediate truncf/extf pairs inserted during all f32 promotions' and 'handle these promotion-generated op pairs uniformly' yet you only want to support the cast pairs emitted by these two passes and not the other fp data types.
The elimination pass not only deals with the cast pairs emitted by the two pass. It deals with all the (bf16 / fp16 <-> f32) cast pairs exist in the IR when the pass is called. In the previous conversation, I said `the pass should be executed after f32 promotion`, because such promotion pass will insert the most cast pairs. After that, the `elimination pass` can then be fully utilized. And the pass sequence `f32 promotion -> elimination` is recommended.
> I don't follow this part. What would make it confusing? What do you mean by 'conceptually different'?
I think `fast-math` is a much lower level optimization. And since in LLVM IR fptrunc and fpext can't carry fastmath flags, I am not sure, if there's a single `fptrunc` with `fastmath attr` exist in MLIR IR, can it be converted to LLVMIR successfully?
https://github.com/llvm/llvm-project/pull/93443
More information about the Mlir-commits
mailing list