[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 07:24:05 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 hope the PatternMatch change is fine.
> 
> It doesn't seem like an improvement, given that you still need to `cast<BinaryOperator>` for both afterwards.

Personally, I find a match to be more readable than multiple `getOperand(0)` and `getOperand(1)`, but if you feel this is not an improvement, I can drop this hunk.

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


More information about the llvm-commits mailing list