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

Zhennan Qin llvmlistbot at llvm.org
Wed May 29 22:47:24 PDT 2024


ZhennanQin wrote:

> > 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?

In traditional compiler world(saying LLVM), fast-math is a combination of below flags:

```
AllowReassoc
NoNaNsĀ 
NoInfs
NoSignedZeros
AllowReciprocal
AllowContract
ApproxFunc
```
Clearly, the rounding elimination doesn't belong to any of them. Adding this optimization into fast-math will make fast-math definition different between LLVM and MLIR. This will create confusion.


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


More information about the Mlir-commits mailing list