[flang-commits] [flang] [mlir] [RFC][mlir] Conditional support for fast-math attributes. (PR #125620)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Mon Feb 3 18:47:55 PST 2025


vzakhari wrote:

> > and my goal to add fast-math support for arith.select operation
> 
> Why would we want to have fast math flags over `arith.select`? What optimizations / rewrites does this allow?

For example, it enables vectorization of loops with min/max reductions in LLVM. Flang is currently producing `arith.select` without fast-math attrs.

In general, in LLVM any instruction that produces a floating point result may have fast-math flags. This includes FP PHIs and selects.

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


More information about the flang-commits mailing list