[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 5 09:32:18 PST 2024


arsenm wrote:

> * Which value allows generating the "fastest" math code -- disregarding correctness? I'd assume that "dynamic" is least optimizable, "ieee" in the middle, and "preserve-sign" is likely to generate the "fastest" code?

This depends on the target and operations. For some functions, on modern hardware, the preserve-sign code will be worse for AMDGPU. In other cases it's better 

> What is the likely actual impact of choosing the wrong value? Ie, what does "it is not always safe" mean? Is this wrong beyond what is usually expected from -ffast-math optimizations?

The main example is the conversions performed between fcmp with 0 and llvm.is.fpclass. You'll get different results depending on whether the input is implicitly flushed in fcmp vs. not in the is.fpclass 

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


More information about the cfe-commits mailing list