Re: [patch] [match.pd]: missing optimization on comparison

2018-09-02 Thread Marc Glisse
On Sun, 2 Sep 2018, Bernhard Reutner-Fischer wrote: On 30 August 2018 22:20:06 CEST, Marc Glisse wrote: Hello, INTEGRALS_SIGN_PREC_MATCH: the name doesn't really match the semantics. +#define INTEGRALS_SIGN_PREC_MATCH(A, B) \ + TYPE_PRECISION (TREE_TYPE (A)) == TYPE_PRECISION

Re: [patch] [match.pd]: missing optimization on comparison

2018-09-02 Thread Bernhard Reutner-Fischer
On 30 August 2018 22:20:06 CEST, Marc Glisse wrote: >Hello, > >INTEGRALS_SIGN_PREC_MATCH: the name doesn't really match the semantics. +#define INTEGRALS_SIGN_PREC_MATCH(A, B) \ + TYPE_PRECISION (TREE_TYPE (A)) == TYPE_PRECISION (TREE_TYPE (B)) \ + (TYPE_PRECISION (TREE_TYPE (A)) >

Re: [patch] [match.pd]: missing optimization on comparison

2018-08-30 Thread Marc Glisse
Hello, why not put these right next to the one that does x==0 & y==0? INTEGRALS_SIGN_PREC_MATCH: the name doesn't really match the semantics. You may need to add a bunch of :s. I always wonder if such transformations should be blocked until a late gimple pass so we keep the more natural form

Re: [patch] [match.pd]: missing optimization on comparison

2018-08-30 Thread Kai Tietz
Sorry, I attached a patch file with an minor bug. Kai Hi, this patch implements some folding patterns about integral comparison of condition. I noticed the lack of folding in gcc by comparing gcc with llvm result. These optimization are interesting as they are helping to linearize some

[patch] [match.pd]: missing optimization on comparison

2018-08-30 Thread Kai Tietz
i, this patch implements some folding patterns about integral comparison of condition. I noticed the lack of folding in gcc by comparing gcc with llvm result. These optimization are interesting as they are helping to linearize some conditional expressions. The following patterns are