Re: [PING] [PATCH] Fix PR31096

2016-11-29 Thread Hurugalawadi, Naveen
Hi Jeff, >> I believe Richi asked for a small change after which you can consider >> the patch approved: Yeah. Thanks for all the comments and reviews. Patch committed after the modification as:- https://gcc.gnu.org/ml/gcc-cvs/2016-11/msg01019.html Thanks, Naveen

Re: [PING] [PATCH] Fix PR31096

2016-11-29 Thread Jeff Law
On 11/22/2016 10:25 PM, Hurugalawadi, Naveen wrote: Hi, Please consider this as a personal reminder to review the patch at following link and let me know your comments on the same. https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01049.html I believe Richi asked for a small change after which you

Re: [PATCH] Fix PR31096

2016-11-23 Thread Richard Biener
On Fri, Nov 11, 2016 at 11:19 AM, Hurugalawadi, Naveen wrote: > Hi, > > Sorry for a very late reply as the mail was missed or overlooked. > >>> could now move the test tree_expr_nonzero_p next to >>> tree_expr_nonnegative_p (it is redundant for the last case). > > Done. > >>> Often just a commen

Re: [PING] [PATCH] Fix PR31096

2016-11-22 Thread Marc Glisse
On Wed, 23 Nov 2016, Hurugalawadi, Naveen wrote: Please consider this as a personal reminder to review the patch at following link and let me know your comments on the same. https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01049.html Hi, the gcc part looks good to me (I didn't look at the tests

[PING] [PATCH] Fix PR31096

2016-11-22 Thread Hurugalawadi, Naveen
Hi, Please consider this as a personal reminder to review the patch at following link and let me know your comments on the same. https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01049.html Thanks, Naveen

Re: [PATCH] Fix PR31096

2016-11-11 Thread Hurugalawadi, Naveen
Hi, Sorry for a very late reply as the mail was missed or overlooked. >> could now move the test tree_expr_nonzero_p next to >> tree_expr_nonnegative_p (it is redundant for the last case). Done. >> Often just a comment can really help here. Comments updated as per the suggestion >> when

Re: [PATCH] Fix PR31096

2016-07-13 Thread Jeff Law
On 04/14/2016 12:45 AM, Hurugalawadi, Naveen wrote: Hi, >> I think we should handle at least INTEGER_CST and SSA_NAME >> with VRP, and it seems natural to add a VRP check The check should be added in the tree_single_nonzero_warnv_p for SSA_NAME case for tree_expr_nonzero_p. However, for tree_e

Re: [PATCH] Fix PR31096

2016-04-15 Thread Marc Glisse
On Thu, 14 Apr 2016, Hurugalawadi, Naveen wrote: I think we should handle at least INTEGER_CST and SSA_NAME with VRP, and it seems natural to add a VRP check The check should be added in the tree_single_nonzero_warnv_p for SSA_NAME case for tree_expr_nonzero_p. I think so. However, for tre

Re: [PATCH] Fix PR31096

2016-04-13 Thread Hurugalawadi, Naveen
Hi, >> I think we should handle at least INTEGER_CST and SSA_NAME >> with VRP, and it seems natural to add a VRP check The check should be added in the tree_single_nonzero_warnv_p for SSA_NAME case for tree_expr_nonzero_p. However, for tree_expr_nonnegative_p, its been handled in a different w

Re: [PATCH] Fix PR31096

2016-04-12 Thread Marc Glisse
On Tue, 12 Apr 2016, Hurugalawadi, Naveen wrote: +/* Fold A * 10 == B * 10 into A == B. */ +(for cmp (eq ne) + (simplify + (cmp (mult:c @0 @1) (mult:c @2 @1)) + (if (INTEGRAL_TYPE_P (TREE_TYPE (@1)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0)) + && tree_expr_nonzero_p (@1)) + (c

Re: [PATCH] Fix PR31096

2016-04-12 Thread Hurugalawadi, Naveen
Hi, >> type is the return type of the comparison. The relevant type here is TREE_TYPE (@0). Done. >>Maybe add a testcase with unsigned, to check that it does not transform? Added the testcase >> you could probably use tree_expr_nonzero_p Done. I had !wi::eq_p (@1, 0) for INTEGER_CST, but when t

Re: [PATCH] Fix PR31096

2016-04-07 Thread Marc Glisse
On Thu, 7 Apr 2016, Hurugalawadi, Naveen wrote: +/* Fold A * 10 == B * 10 into A == B. */ +(for cmp (eq ne) + (simplify + (cmp (mult:c @0 @1) (mult:c @2 @1)) + (if (TYPE_OVERFLOW_UNDEFINED (type) type is the return type of the comparison. The relevant type here is TREE_TYPE (@0). Maybe add

Re: [PATCH] Fix PR31096

2016-04-07 Thread Hurugalawadi, Naveen
Hi, Thanks for the review, views and comments on the issue. >> -1 is an integer constant, so that's still invalid. It is also invalid for >> unsigned. The :s are useless since the output is a single insn. The patch is modified as per your review comments. Currently the following conditions had

Re: [PATCH] Fix PR31096

2016-04-05 Thread Marc Glisse
On Tue, 5 Apr 2016, Hurugalawadi, Naveen wrote: Hi, Looks like you are turning x*-1 < y*-1 into x Please find attached the modified patch that works on integer constant values. Please review the patch and let me know if this is okay? -1 is an integer constant, so that's still invalid. It i

Re: [PATCH] Fix PR31096

2016-04-05 Thread Hurugalawadi, Naveen
Hi, >> Looks like you are turning x*-1 < y*-1 into xdiff --git a/gcc/match.pd b/gcc/match.pd index c0ed305..e073e9f 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -894,7 +894,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && tree_nop_conversion_p (type, TREE_TYPE (@1))) (convert (bit_and (b

Re: [PATCH] Fix PR31096

2016-03-31 Thread Ramana Radhakrishnan
On 31/03/16 09:55, Hurugalawadi, Naveen wrote: > +/* { dg-final { scan-assembler-not "addl" } } */ addl is not the mnemonic for add on all architectures Ramana

Re: [PATCH] Fix PR31096

2016-03-31 Thread Marc Glisse
On Thu, 31 Mar 2016, Hurugalawadi, Naveen wrote: Hi, Please find attached the patch that fixes the PR31096. Should the optimization be extended to addition and other operations as well? Please review the patch and let me know if its okay? Regression tested on X86_64. Thanks, Naveen 2016-03-

[PATCH] Fix PR31096

2016-03-31 Thread Hurugalawadi, Naveen
Hi, Please find attached the patch that fixes the PR31096. Should the optimization be extended to addition and other operations as well? Please review the patch and let me know if its okay? Regression tested on X86_64. Thanks, Naveen 2016-03-31 Naveen H.S * match.pd (cmp (mult:cs @