[llvm] [DAG] Optimize Constant Xor And And Not Operation (PR #161784)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 24 03:11:39 PDT 2025
jayfoad wrote:
> > The pattern seems overly-specific. If this is a good idea, why not apply it more generally to associative expressions? Quoting my comment from #161630:
> > > Yes it is reassociation, and should be done consistently for any associative operation, not just for this very specific case. Also this transformation is not always beneficial since it can increase register pressure if both b and c have further uses.
>
> Do you think it would be beneficial to add a check that both b and c have one use before making this change? @jayfoad
Maybe, but I'd really like to know whether SelectionDAG has a general policy for that kind of thing. Does it ever try to make a sensible choice between reducing latency and increasing register pressure?
https://github.com/llvm/llvm-project/pull/161784
More information about the llvm-commits
mailing list