992.c
> >> > > b/gcc/testsuite/gcc.dg/pr104992.c
> >> > > >> > new file mode 100644
> >> > > >> > index 000..b4b0ca53118
> >> > > >> > --- /dev/null
> >> > > >> > +++ b/gcc/testsuite/gcc.dg/pr104992
On Wed, Jul 27, 2022 at 9:57 PM Sam Feifer wrote:
>
>
>> _Complex int are strange beasts, I'd simply avoid the transform for them.
>>
>
> I added to the match.pd rule to not simplify if the operands are complex.
> There is now a test case for complex types to make sure they do not simplify.
> I
mp-tree-optimized" } */
> > > >> > +
> > > >> > +/* Form from PR. */
> > > >> > +__attribute__((noipa)) unsigned foo(unsigned x, unsigned y)
> > > >> > +{
> > > >> > + return x / y * y == x;
> > > &
On Tue, Jul 26, 2022 at 4:32 PM Sam Feifer via Gcc-patches
wrote:
>
> >
> > int f(_Complex int x, _Complex int y)
> > {
> > return x == x / y * y;
> > }
> >
>
> After some research about mod with complex types, I found that the binary
> mod operation does not work with complex types. If so, the
>
> int f(_Complex int x, _Complex int y)
> {
> return x == x / y * y;
> }
>
After some research about mod with complex types, I found that the binary
mod operation does not work with complex types. If so, the complex test
case should not be simplified. Is this correct?
I should also note that
On Mon, Jul 25, 2022 at 1:59 PM Sam Feifer wrote:
>
>
>> I suspect for eq and mult you might want to add :c to them even though
>> in your testcase you don't need them, you might be able to get it via
>> using different statements and looking at the forwprop gimple dump.
>> Also, did you send the
> I suspect for eq and mult you might want to add :c to them even though
> in your testcase you don't need them, you might be able to get it via
> using different statements and looking at the forwprop gimple dump.
> Also, did you send the wrong patch as it looks like the function call
> to build_z
On Mon, Jul 25, 2022 at 12:37 PM Sam Feifer via Gcc-patches
wrote:
>
> This patch fixes a missed optimization in match.pd. It takes the pattern, x /
> y * y == x, and optimizes it to x % y == 0. This produces fewer instructions.
>
> There are also tests for the optimizations to be added to the te
This patch fixes a missed optimization in match.pd. It takes the pattern, x / y
* y == x, and optimizes it to x % y == 0. This produces fewer instructions.
There are also tests for the optimizations to be added to the test suite.
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?