[llvm] LICM: hoist BO assoc for FAdd and FMul (PR #108415)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 06:57:02 PDT 2024


artagnon wrote:

> Is it OK to reassociate `(A +ninf,reassoc B) +ninf,reassoc C` to `A +ninf,reassoc (B +ninf,reassoc C)`? The reassociation might introduce an infinity in the intermediate result B+C where there was none before, which the ninf will turn into poison.

We're actually reassociating `(A +ninf,nsz,reassoc B) +ninf,nsz,reassoc C`, since both `nsz` and `reassoc` are necessary conditions for the BinOp to be commutative, but I can see how this is a problem. Do you know what the general approach should be? Is only `ninf` problematic, or should we reassociate only copying `nsz` and `reassoc`?

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


More information about the llvm-commits mailing list