On Thu, Dec 11, 2025 at 03:55:39PM -0800, Andrew Pinski wrote: > I am still not happy with the constant check. > Can you provide a testcase where the constant check is worse? What is > the before and after check? > Attach the combine dumps if needed because the below:
> > Example Trace (IOR Form - Regressed): > > > > When we have a sequence of ROTATE(A) + AND(A, C) + ANDN(B, C) + IOR (A,B) > > 1) combine sees: (rotate %a) & c > > 2) Simplifies to: lshiftrt %a (loss of IOR form semantics) > > 3) Result: We end up with 3 instructions: lshiftrt, andn, ior. > > This is the part I am not getting. Specifically the whole `+` part and > which instructions are being combined. Yeah. > Which means there might be a missing rs6000 pattern for this case? No, we have literally all possible logical patterns here. simplify-rtx still cannot simplify some cases with subregs of shifts, that it should simplify to shifts of subregs instead (wherever that is valid; it is valid in way more cases than it handles currently). There are PRs for this. Segher
