[llvm] [InstCombine] Do not require nsz for reassociating fmul (PR #93698)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 13:07:56 PDT 2024


jayfoad wrote:

> You shouldn't need `nsz` for reassociating `fadd` either. The sign of a 0.0 in default rounding mode (which `fadd` implies) is the bitwise and of the sign bits of the inputs, and consequently, it's associative in that case.

Yeah, I agree, but I had to think hard about it. The only way (a+b)+c can be -0 is if a b c are all -0, in which case reassociating obviously doesn't change the result.

Anyway I would do that as a separate PR. 

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


More information about the llvm-commits mailing list