[llvm] LICM: use PatternMatch, IRBuilder in hoist BO assoc (PR #106978)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 2 05:58:14 PDT 2024
artagnon wrote:
> The change to use IRBuilder looks good to me, but the rest seems like it will make generalization harder, not easier.
I was thinking we could first extend the same case to commutative ops: so `std::swap(LV, C1)` should suffice no?
> You dropped some important checks that are only relevant for generalization, such as the need to check that both binops are associative (this is not implied by having the same opcode) or that the nuw transfer logic is only correct for adds.
Fixed this thinko.
https://github.com/llvm/llvm-project/pull/106978
More information about the llvm-commits
mailing list