On Thu, Dec 30, 2021 at 09:22:51AM -0700, Jeff Law via Gcc-patches wrote:
> On 12/28/2021 6:27 PM, Xionghu Luo via Gcc-patches wrote:
> > Bootstrapped and regtested on powerpc64le-linux-gnu {P10,P9}
> > powerpc64-linux-gnu {P8, P7} and X86.  OK for master?
> > 
> > gcc/ChangeLog:
> > 
> >     PR 90323
> >     * simplify-rtx.c (simplify_context::simplify_binary_operation_1): Relax
> >     C from constant to constant or reg.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> >     * gcc.target/powerpc/pr90323.c: New test.
> If C is not a constant and the target does not have and-complement
> instructions, then this is likely worse than the original.  If you want to
> do this transformation, then you probably need to be checking target costs.

I'm not sure we can check costs because what simplify_* is fed especially
during combine might be far from what is a valid instruction and checking
costs on something that isn't valid could lead to bogus results.
Perhaps check if the andnot optab exist for the mode, except we don't have
such an optab...

        Jakub

Reply via email to