[llvm] LICM: hoist BO assoc when (C1 op LV) op C2 (PR #106999)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 02:05:26 PDT 2024


nikic wrote:

> > > You can just assert that the op is commutative (after the associativity check). In general, all associative ops we support are also commutative.
> > 
> > 
> > Little confused by this. Aren't `FAdd` and `FMul` commutative, but not associative?
> 
> Sorry, I should have been clearer: if we check for associativity before commutativity, does it mean that we don't see future work supporting `FAdd` and `FMul`?

FAdd and FMul are associative if the necessary FMF flags are set. The non-static member function will report them as such.

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


More information about the llvm-commits mailing list