Re: [RFC][IPA-VRP] Early VRP Implementation

2016-08-22 Thread Kugan Vivekanandarajah
Hi, On 19 August 2016 at 21:41, Richard Biener <richard.guent...@gmail.com> wrote: > On Tue, Aug 16, 2016 at 9:45 AM, kugan > <kugan.vivekanandara...@linaro.org> wrote: >> Hi Richard, >> >> On 12/08/16 20:43, Richard Biener wrote: >>> >>> On W

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-19 Thread Kugan Vivekanandarajah
Ping? https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00872.html Thanks, Kugan On 11 August 2016 at 09:09, kugan <kugan.vivekanandara...@linaro.org> wrote: > Hi, > > > On 10/08/16 20:28, Richard Biener wrote: >> >> On Wed, Aug 10, 2016 at 10:57 AM, Jakub Je

Re: [RFC][PR61839]Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) : (CST BINOP 0)

2016-08-19 Thread Kugan Vivekanandarajah
Ping? https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00987.html Thanks, Kugan On 12 August 2016 at 13:19, kugan <kugan.vivekanandara...@linaro.org> wrote: > Hi Richard, > > > On 11/08/16 20:04, Richard Biener wrote: >> >> On Thu, Aug 11, 2016 at 6:11 AM,

Re: [TREE-SSA-CCP] Issue warning when folding condition

2016-08-18 Thread Kugan Vivekanandarajah
On 19 August 2016 at 12:09, Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> wrote: > The testcase pr33738.C for warning fails with early-vrp patch. The > reason is, with early-vrp ccp2 is folding the comparison that used to > be folded in simplify_stmt_for_jump_threadi

[TREE-SSA-CCP] Issue warning when folding condition

2016-08-18 Thread Kugan Vivekanandarajah
-ssa-ccp.c. We might also run into some other similar issues in the future. Bootstrapped and regression tested on x86_64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-08-18 Kugan Vivekanandarajah <kug...@linaro.org> * tree-ssa

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-08-16 Thread kugan
Hi Richard, On 17/08/16 08:20, kugan wrote: Hi, On 16/08/16 21:56, Richard Biener wrote: On Tue, Aug 16, 2016 at 10:09 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: On 23/07/16 20:12, kugan wrote: Hi Richard, As we had value_range_type in tree-ssanames.h why not put value

Re: [RFC][IPA-VRP] splits out the update_value_range calls from vrp_visit_stmt

2016-08-16 Thread kugan
Hi, On 16/08/16 20:58, Richard Biener wrote: On Tue, Aug 16, 2016 at 9:39 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi, as said the refactoring that would be appreciated is to split out the update_value_range calls from the worker functions so you can call the respective fun

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-08-16 Thread kugan
Hi, On 16/08/16 21:56, Richard Biener wrote: On Tue, Aug 16, 2016 at 10:09 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: On 23/07/16 20:12, kugan wrote: Hi Richard, As we had value_range_type in tree-ssanames.h why not put value_range there? For IPA_VRP, we now need value

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-08-16 Thread kugan
On 23/07/16 20:12, kugan wrote: Hi Richard, As we had value_range_type in tree-ssanames.h why not put value_range there? For IPA_VRP, we now need value_range used in ipa-prop.h (in ipa-vrp patch). Based on this, attached patch now adds struct value_range to tree-ssanames.h and fixes

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-08-16 Thread kugan
Hi Richard, On 12/08/16 20:43, Richard Biener wrote: On Wed, Aug 3, 2016 at 3:17 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: [SNIP] diff --git a/gcc/common.opt b/gcc/common.opt index 8a292ed..7028cd4 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2482,6 +2482,10 @@ ftr

[RFC][IPA-VRP] splits out the update_value_range calls from vrp_visit_stmt

2016-08-16 Thread kugan
is a patch that just splits out the update_value_range calls visit_stmts. Bootstrapped and regression tested on x86_64-linux with no new regressions. I also verified few random fdump-tree-vrp1-details from stage2 to make sure they are same. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog

Re: [RFC][PR61839]Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) : (CST BINOP 0)

2016-08-11 Thread kugan
Hi Richard, On 11/08/16 20:04, Richard Biener wrote: On Thu, Aug 11, 2016 at 6:11 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: [SNIP] +two_valued_val_range_p (tree var, tree *a, tree *b) +{ + value_range *vr = get_value_range (var); + if ((vr->type != VR_RANGE +

Re: [RFC][PR61839]Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) : (CST BINOP 0)

2016-08-10 Thread kugan
Hi Richard, On 09/08/16 20:22, Richard Biener wrote: On Tue, Aug 9, 2016 at 4:51 AM, Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> wrote: Hi Richard, Thanks for the review. On 29 April 2016 at 20:47, Richard Biener <richard.guent...@gmail.com> wrote: On Sun, Apr 1

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-10 Thread kugan
Hi, On 10/08/16 20:28, Richard Biener wrote: On Wed, Aug 10, 2016 at 10:57 AM, Jakub Jelinek <ja...@redhat.com> wrote: On Wed, Aug 10, 2016 at 08:51:32AM +1000, kugan wrote: I see it now. The problem is we are just looking at (-1) being in the ops list for passing changed to rewrite_exp

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-10 Thread kugan
On 10/08/16 18:57, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 08:51:32AM +1000, kugan wrote: I see it now. The problem is we are just looking at (-1) being in the ops list for passing changed to rewrite_expr_tree in the case of multiplication by negate. If we have combined (-1

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
On 10/08/16 08:51, kugan wrote: Hi Jakub, On 10/08/16 07:55, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 07:51:08AM +1000, kugan wrote: On 10/08/16 07:46, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 07:42:25AM +1000, kugan wrote: There was no new regression while testing. I also moved

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
Hi Jakub, On 10/08/16 07:55, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 07:51:08AM +1000, kugan wrote: On 10/08/16 07:46, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 07:42:25AM +1000, kugan wrote: There was no new regression while testing. I also moved the testcase from gcc.dg/torture

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
Hi Andrew, On 10/08/16 07:50, Andrew Pinski wrote: On Tue, Aug 9, 2016 at 2:42 PM, kugan <kugan.vivekanandara...@linaro.org> wrote: On 09/08/16 23:43, kugan wrote: Hi, The test-case in PR72835 is failing with -O2 and passing with -fno-tree-reassoc. It also passes with -O2 -fno-tr

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
Hi Jakub, On 10/08/16 07:46, Jakub Jelinek wrote: On Wed, Aug 10, 2016 at 07:42:25AM +1000, kugan wrote: There was no new regression while testing. I also moved the testcase from gcc.dg/torture/pr72835.c to gcc.dg/tree-ssa/pr72835.c. Is this OK for trunk? This looks strange. The tree-ssa

Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
On 09/08/16 23:43, kugan wrote: Hi, The test-case in PR72835 is failing with -O2 and passing with -fno-tree-reassoc. It also passes with -O2 -fno-tree-vrp. diff of .115t.dse2 and .116t.reassoc1 for the c++ testcase is as follows, which looks OK. + unsigned int _16; + unsigned int _17

[PR72835] Incorrect arithmetic optimization involving bitfield arguments

2016-08-09 Thread kugan
resets it. With this, the testcases in TH PR is now working. Bootstrap and regression testing for x86_64-linux-gnu is in progress. Is this OK for trunk if there is no regression. Thanks, Kugan gcc/testsuite/ChangeLog: 2016-08-09 Kugan Vivekanandarajah <kug...@linaro.org> P

Re: [RFC][PR61839]Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) : (CST BINOP 0)

2016-08-08 Thread Kugan Vivekanandarajah
Hi Richard, Thanks for the review. On 29 April 2016 at 20:47, Richard Biener <richard.guent...@gmail.com> wrote: > On Sun, Apr 17, 2016 at 1:14 AM, kugan > <kugan.vivekanandara...@linaro.org> wrote: >> As explained in PR61839, >> >> Following difference result

Re: Set nonnull attribute to ptr_info_def based on VRP

2016-08-08 Thread kugan
Hi Jakub, Thanks for the review. On 08/08/16 16:40, Jakub Jelinek wrote: On Mon, Aug 08, 2016 at 01:36:51PM +1000, kugan wrote: diff --git a/gcc/tree-ssanames.h b/gcc/tree-ssanames.h index c81b1a1..6e34433 100644 --- a/gcc/tree-ssanames.h +++ b/gcc/tree-ssanames.h @@ -43,6 +43,9 @@ struct GTY

Set nonnull attribute to ptr_info_def based on VRP

2016-08-07 Thread kugan
be used in IPA-VRP such that redundant check for NULL can be eliminated. Bootstrapped and regression tested on x86_64-linux-gnu. Is this OK for trunk. Thanks, Kugan gcc/ChangeLog: 2016-08-08 Kugan Vivekanandarajah <kug...@linaro.org> * tree-ssanames.c (set_ptr_nonnull

[RFC] Use ccp mask and val to refine value_range

2016-08-07 Thread kugan
uot;loop with 4 iterations completely unrolled" 2 gcc.dg/tree-ssa/pr61743-1.c scan-tree-dump-times cunroll "loop with 8 iterations completely unrolled" 2 gcc.dg/tree-ssa/ssa-dom-thread-7.c scan-tree-dump thread3 "Jumps threaded: 3" ## Differences found: # 1 differences in 1

Re: make streaming routines for widest_int non-static

2016-08-05 Thread kugan
-bitwise-cp patch ? Bootstrap+test in progress on x86_64-unknown-linux-gnu. OK for trunk ? I think I approved a better patch from Kugan. Sorry, I was waiting for the other patches to get approved. Since this is needed for Prathamesh too, I will commit after testing this patch alone. Thanks. Kugan

Re: [RFC] ipa bitwise constant propagation

2016-08-04 Thread kugan
at this point), some of the ranges can be pessimistic and can impact the estimation. Let me have a look at this. Thanks, Kugan

Re: [RFC] ipa bitwise constant propagation

2016-08-04 Thread kugan
fixed in https://patchwork.ozlabs.org/patch/648662/. I will commit that soon. Thanks, Kugan

Re: [LTO] Add wide_int streaming support

2016-08-04 Thread kugan
Hi Richard, Thanks for the review. On 04/08/16 17:26, Richard Biener wrote: On Thu, Aug 4, 2016 at 6:12 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi, During IPA-VRP implementation, I realized that we don't support streaming wide_int in LTO. Attached patch does this.

[LTO] Add wide_int streaming support

2016-08-03 Thread kugan
Hi, During IPA-VRP implementation, I realized that we don't support streaming wide_int in LTO. Attached patch does this. Tested with IPA-VRP. Is this OK for trunk if bootstrap and regression testing is fine. Thanks, Kugan gcc/ChangeLog: 2016-08-04 Kugan Vivekanandarajah <

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-08-02 Thread kugan
Hi Richard, Thanks for the review. On 28/07/16 21:34, Richard Biener wrote: On Thu, Jul 28, 2016 at 9:35 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi Richard, Thanks for the review. It seems that in your pop_value_range you assume you only pop one range per BB - while

Re: [RFC][PR68217] Improve value range for signed & sign-bit-CST

2016-07-28 Thread kugan
Hi Richard, Thanks for the review. On 27/04/16 00:14, Richard Biener wrote: On Fri, Apr 15, 2016 at 12:44 PM, kugan <kugan.vivekanandara...@linaro.org> wrote: As pointed out by Richard, for signed & sign-bit-CST value range should be [-INF, 0] range, not a [-INF, INF] range as h

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-07-28 Thread kugan
re-evaluated till the lattice reach a fixpoint. Is that OK with you? If we are to do this, we should be able to reuse the callbacks vrp_visit_phi_node and vrp_visit_stmt as it is. Do you have a reference to your DOM based prototype? Thanks, Kugan Btw, you don't want to call vrp_initialize in evrp eit

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread kugan
are right. The problem was with the order of checking tcc_compare and calling get_ops. We ended up calling get_ops where we should not. Bootstrap and regression testing is ongoing. Is this OK for trunk if no regressions? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-07-27 Kugan Vivekanandarajah

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread kugan
Hi Richard, On 26/07/16 21:48, Richard Biener wrote: On Tue, Jul 26, 2016 at 5:13 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi, For testcase in pr71994, type of bb conditional result and the type of the PHI stmt are different (as om.0_1 is int and the first PHI argument is

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-07-26 Thread kugan
to test. I have tested the last set of patch separately. I will do more testing on this patch based on your feedback. Does this look better? Thanks, Kugan >From eefcd1c5444cf5dd9f121e8bd04148d324d06ffc Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah <kugan.vivek

[Bug tree-optimization] Fix for PR71994

2016-07-25 Thread kugan
should check the type before replacing the value (punt otherwise). Attached patch does that. Bootstrapped and regression tested on x86_64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-07-26 Kugan Vivekanandarajah <kug...@linaro.org>

Re: [PATCH] Call get_ops just for SSA_NAMEs (PR tree-optimization/71987)

2016-07-25 Thread kugan
operand_entry *oe = operand_entry_pool.allocate (); Sorry about the breakage. Since final_range_test_p allows either lhs or rhs to be SSA_NAME (for the different cases it accepts), we should indeed check for TREE_CODE being SSA_NAME. Unfortunately it didn't trigger in my testing. Lets wait for the maintainers conformation. Thanks for working on this, Kugan

Re: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null

2016-07-25 Thread kugan
rest of the patches in the series. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-07-25 Kugan Vivekanandarajah <kug...@linaro.org> * tree-vrp.c (extract_range_basic): Check cfun->after_inlining before folding call to __builtin_constant_p wit

Re: [PATCH] Teach VRP to register assertions along default switch labels (PR 18046)

2016-07-23 Thread kugan
large number of ASSERT_EXPRs in the default basic block. I am not sure if this would have any impact on compile time/memory usage? If that is the case you might want to punt at some length? Thanks, Kugan

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-07-23 Thread kugan
had to add other headers in few places due to the dependency. Are you OK with this ? Here is alternate patch where we keep struct value_range and enum value_range_type to tree-vrp.h. May be it is a better approach? Please let me know what is your preference. Thanks, Kugan >F

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-07-22 Thread kugan
Hi Richard, Thanks for the review. On 22/07/16 22:49, Richard Biener wrote: On Fri, Jul 22, 2016 at 2:27 PM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi, Now that early vrp is moved as part of tree-vrp, there is only minimal interface tree-vrp should expose for ipa-vrp. Howe

Re: [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-07-22 Thread kugan
. Thanks, Kugan >From 2e7d10923fefddafdeffc571e870508ac0ee193c Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> Date: Tue, 21 Jun 2016 12:42:44 +1000 Subject: [PATCH 4/7] Refactor vrp --- gcc/tree-ssanames.h | 5 - gcc/tree-vrp.c

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-07-22 Thread kugan
Hi Richard, Thanks for the review. On 18/07/16 21:51, Richard Biener wrote: On Fri, Jul 15, 2016 at 9:33 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi Andrew, On 15/07/16 17:28, Andrew Pinski wrote: On Fri, Jul 15, 2016 at 12:08 AM, kugan <kugan.vivekanandara...@linaro.o

[VRP] Use alloc-pool and obstack for value_range and vr->equiv allocations

2016-07-19 Thread kugan
OK for trunk. Thanks, Kugan gcc/ChangeLog: 2016-07-20 Kugan Vivekanandarajah <kug...@linaro.org> * tree-vrp.c (set_value_range): Use vrp_equiv_obstack with BITMAP_ALLOC. (add_equivalence): Likewise. (get_value_range): Allocate value range with vrp_value_r

Re: [RFC][IPA-VRP] Add support for IPA VRP in ipa-cp/ipa-prop

2016-07-19 Thread kugan
Hi Martin, On 19/07/16 18:22, kugan wrote: Hi Martin, Thanks for the review. I have revised the patch based on the review. Please see the comments below. Maybe it is better to separate value range and alignment summary writing/reading to different functions. Here is another updated

Re: [RFC][IPA-VRP] Add support for IPA VRP in ipa-cp/ipa-prop

2016-07-19 Thread kugan
Hi Martin, Thanks for the review. I have revised the patch based on the review. Please see the comments below. On 15/07/16 22:23, Martin Jambor wrote: Hi, thanks for working on extending IPA-CP in this way. I do have a few comments though: On Fri, Jul 15, 2016 at 02:46:50PM +1000, kugan

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-07-15 Thread kugan
Hi Andrew, On 15/07/16 17:28, Andrew Pinski wrote: On Fri, Jul 15, 2016 at 12:08 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: Hi Andrew, Why separate out early VRP from tree-vrp? Just a little curious. It is based on the discussion in https://gcc.gnu.org/ml/gcc/2016-01/ms

Re: [RFC][IPA-VRP] Early VRP Implementation

2016-07-15 Thread kugan
. I will give this a try. Thanks, Kugan

Re: [RFC][IPA-VRP] Check for POINTER_TYPE_P before accessing SSA_NAME_PTR_INFO in tree-inline

2016-07-15 Thread kugan
fo; /* Value range attributes used for zero/sign extension elimination. */ struct GTY ((tag ("1"))) range_info_def *range_info; } GTY ((desc ("%1.typed.type ?" \ "!POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info; Thanks, Kugan

[RFC][IPA-VRP] Teach tree-vrp to use the VR set in params

2016-07-14 Thread kugan
Hi, This patch teaches tree-vrp to use the VR set in params. Thanks, Kugan gcc/ChangeLog: 2016-07-14 Kugan Vivekanandarajah <kug...@linaro.org> * tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp results.

[RFC][IPA-VRP] Add support for IPA VRP in ipa-cp/ipa-prop

2016-07-14 Thread kugan
Hi, This patch extends ipa-cp/ipa-prop infrastructure to handle propagation of VR. Thanks, Kugan gcc/testsuite/ChangeLog: 2016-07-14 Kugan Vivekanandarajah <kug...@linaro.org> * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. *

[RFC][IPA-VRP] Early VRP Implementation

2016-07-14 Thread kugan
Hi, This patch adds a very simple early vrp implementation. This visits the basic blocks in the dominance order and set the Value Ranges (VR) for SSA_NAMEs in the scope. Use this VR to discover more VRs. Restore the old VR once the scope is exit. Thanks, Kugan gcc/ChangeLog

[RFC][IPA-VRP] Re-factor tree-vrp to factor out common code

2016-07-14 Thread kugan
Hi, This patch re-factors common code in tree-vrp to be used in early vrp. I am not entirely sure where I should place struct value_range. For now I have placed in tree.h. Thanks, Kugan 2016-07-14 Kugan Vivekanandarajah <kug...@linaro.org> * tree-ssanames.h

[RFC][IPA-VRP] Check for POINTER_TYPE_P before accessing SSA_NAME_PTR_INFO in tree-inline

2016-07-14 Thread kugan
Hi, This patch adds check for POINTER_TYPE_P before accessing SSA_NAME_PTR_INFO in remap_ssa_name in gcc/tree-inline.c. This is not related to IPA_VRP but was exposed by that. Thanks, Kugan gcc/ChangeLog: 2016-07-14 Kugan Vivekanandarajah <kug...@linaro.org>

[RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null

2016-07-14 Thread kugan
it for the time being. That is, this patch is not intended for committing but just to get the VRP tested. Original patch which introduced this also talks about doing it earlier. Thanks, Kugan >From 99f8e7884d582cfae2d7cb50ad59dab7ac6772fc Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandara

[RFC][IPA-VRP] IPA VRP Implementation

2016-07-14 Thread kugan
bootstrap and LTO bootstrap). There are couple of testcase failures which I am looking into. Any thoughts? Thanks, Kugan

[PR71478] Fix ICE in tree-ssa-reassoc.c

2016-06-09 Thread kugan
with gimple_assign. Attached patch fixes the place where we remove the vector (-1). Regression tested on x86-64-linux-gnu with no new regressions. Regression testing on aarc64-linux-gnu is ongoing. Is this OK for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-06-10 Kugan Vivekanandarajah <

[PR71408] - Fix wrong code at -Os and above

2016-06-05 Thread kugan
on tested and bootstrapped on x86-64-linux-gnu with no new regression. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-06-05 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/71408 * tree-ssa-reassoc.c (zero_one_operation): Fix NEGATE_EXPR operand for

[PR71281] ICE on gcc trunk on knl, wsm, ivb and bdw targets

2016-06-03 Thread kugan
regression. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-06-04 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/71281 * tree-ssa-reassoc.c (reassociate_bb): Set uid for negate stmt. gcc/testsuite/ChangeLog: 2016-06-04 Kugan Vivekanandarajah

[PR66726] Fix regression caused by Factor conversion out of COND_EXPR

2016-06-01 Thread kugan
izing range tests a_5(D) -[128, 159] and -[192, 223] pr46309.c.116t.reassoc1: into (a_5(D) & 4294967231) + 4294967168 > 31 Bootstrapped and regression testing on x86-64-linux-gnu and ppc64le-linux-gnu doesn't have any new regressions. Also did regression testing arm variants which has

Re: [PATCH2][PR71252] Fix insertion point of stmt_to_insert

2016-05-29 Thread kugan
On 28/05/16 01:28, Kugan Vivekanandarajah wrote: Hi Richard, This fix insertion point of stmt_to_insert based on your comments. In insert_stmt_before_use , I now use find_insert_point such that we insert the stmt_to_insert after its operands are defined. This means that we now have to insert

[PATCH2][PR71252] Fix insertion point of stmt_to_insert

2016-05-27 Thread Kugan Vivekanandarajah
PRs Thanks, Kugan gcc/testsuite/ChangeLog: 2016-05-28 Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> * gcc.dg/tree-ssa/pr71269.c: New test. gcc/ChangeLog: 2016-05-28 Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> * tree-ssa-reassoc.c (insert_stm

[PATCH1][PR71252] Fix missing swap to stmt_to_insert

2016-05-27 Thread Kugan Vivekanandarajah
for trunk if the testing is fine ? Thanks, Kugan gcc/ChangeLog: 2016-05-28 Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> * tree-ssa-reassoc.c (swap_ops_for_binary_stmt): Fix swap such that all fields including stmt_to_insert are swapped. gcc/testsuite/ChangeLog: 2016-05-28

Re: [PR71252][PR71269] Fix trunk errors due to stmt_to_insert

2016-05-26 Thread Kugan Vivekanandarajah
Hi Jakub, On 26 May 2016 at 18:18, Jakub Jelinek <ja...@redhat.com> wrote: > On Thu, May 26, 2016 at 02:17:56PM +1000, Kugan Vivekanandarajah wrote: >> --- a/gcc/tree-ssa-reassoc.c >> +++ b/gcc/tree-ssa-reassoc.c >> @@ -3767,8 +3767,10 @@ swap_o

[PR71252][PR71269] Fix trunk errors due to stmt_to_insert

2016-05-25 Thread Kugan Vivekanandarajah
inserted. If that is not the case, we have to insert the stmt_to_insert before calling build_and_add_sum. 4. I also moved all the other stmt_to_insert insertion after the use stmt are created. Also regression tested on x86-64-linux gnu with no new regressions. Is this OK for trunk, Thanks, Kugan gcc/

[PR71252][PATCH] ICE: verify_ssa failed

2016-05-24 Thread Kugan Vivekanandarajah
in reducing the test-case is appreciated. Regression testing on x86_64-linux-gnu and bootstrap didn’t find any new issues. Is this OK for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-05-24 Kugan Vivekanandarajah <kug...@linaro.org> * gfortran.dg/pr71252.f90: New test. gcc/ChangeLog:

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-24 Thread Kugan Vivekanandarajah
On 24 May 2016 at 18:36, Christophe Lyon <christophe.l...@linaro.org> wrote: > On 24 May 2016 at 05:13, Kugan Vivekanandarajah > <kugan.vivekanandara...@linaro.org> wrote: >> On 23 May 2016 at 21:35, Richard Biener <richard.guent...@gmail.com> wrote: >>>

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-23 Thread Kugan Vivekanandarajah
On 23 May 2016 at 21:35, Richard Biener <richard.guent...@gmail.com> wrote: > On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah > <kugan.vivekanandara...@linaro.org> wrote: >> On 20 May 2016 at 21:07, Richard Biener <richard.guent...@gmail.com> wrote: >&

Re: [RFC] Type promotion pass and elimination of zext/sext

2016-05-22 Thread Kugan Vivekanandarajah
work (optimized). I will also try to gather test-cases based on testing/benchmarking. Thanks, Kugan

Re: [RFC] Type promotion pass and elimination of zext/sext

2016-05-22 Thread Kugan Vivekanandarajah
Hi Jeff, On 20 May 2016 at 04:17, Jeff Law <l...@redhat.com> wrote: > On 05/15/2016 06:45 PM, Kugan Vivekanandarajah wrote: >> >> Hi Richard, >> >> Now that stage1 is open, I would like to get the type promotion passes >> reviewed again. I hav

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-21 Thread Kugan Vivekanandarajah
On 20 May 2016 at 21:07, Richard Biener <richard.guent...@gmail.com> wrote: > On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah > <kugan.vivekanandara...@linaro.org> wrote: >> Hi Richard, >> >>> I think it should have the same rank as op or op + 1 which

[PATCH] Fix PR tree-optimization/71179

2016-05-19 Thread Kugan Vivekanandarajah
tested on x86-64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-05-20 Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> * gcc.dg/tree-ssa/pr71179.c: New test. gcc/ChangeLog: 2016-05-20 Kugan Vivekanand

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
multiplication to > rewrite_expr_tree time. For example by adding a ops->stmt_to_insert > member. > Here is an implementation based on above. Bootstrap on x86-linux-gnu is OK. regression testing is ongoing. Thanks, Kugan gcc/ChangeLog: 2016-05-20 Kugan Vivekanandarajah &

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
On 19 May 2016 at 18:55, Richard Biener <richard.guent...@gmail.com> wrote: > On Thu, May 19, 2016 at 10:26 AM, Kugan > <kugan.vivekanandara...@linaro.org> wrote: >> Hi, >> >> >> On 19/05/16 18:21, Richard Biener wrote: >>> On Th

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan
Hi, On 19/05/16 18:21, Richard Biener wrote: > On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah > <kugan.vivekanandara...@linaro.org> wrote: >> Hi Martin, >> >> Thanks for the fix. Just to elaborate (as mentioned in PR) >> >> At tree-ssa-reasso

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
We could try Martin Liška's approach, We could also move _17 = c_7(D) * 3; at tree-ssa-reassoc.c:3897 satisfy the gcc_assert. We could do this based on the use count of _17. This patch does this. I have no preferences. Any thoughts ? Thanks, Kugan On 19 May 2016 at 18:04, Martin Liška &

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-05-18 Thread Kugan
Hi Martin, > > I see various ICE after your commit r236356: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71170 Sorry for the breakage. Looking into it. Thanks, Kugan

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-05-18 Thread Kugan Vivekanandarajah
nus_onep (last->op)) Is this Still OK. Bootstrap and regression testing on ARM, AARCH64 and x86-64 didn’t have any new regressions. Thanks, Kugan diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr40921.c b/gcc/testsuite/gcc.dg/tree-ssa/pr40921.c index e69de29..3a5a23a 100644 --- a/gcc/testsuite/gcc.dg/

[AARCH64] Remove static variable all_extensions from aarch64.c

2016-05-16 Thread Kugan Vivekanandarajah
Hi, static variable all_extensions in aarch64.c is not used and therefore dead. I don’t see any reason why it should be there. Attached patch removes this. Bootstrapped on aarch64-linux-gnu. Regression testing is ongoing. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-05-17 Kugan

[RFC] Type promotion pass and elimination of zext/sext

2016-05-15 Thread Kugan Vivekanandarajah
that based on the feedback. Please let me know what you thing. Thanks, Kugan From 332e0e9f938c6af50e826d8224d07ebf3678a0e0 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah <kugan.vivekanandara...@linaro.org> Date: Fri, 13 May 2016 13:41:01 +1000 Subject: [PATCH 4/4] Add new type promotio

[RFC][PR70841] Reassoc fails to handle FP division

2016-05-04 Thread kugan
testing on x86-64-linux-gnu. Does this look Ok for trunk? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-05-05 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/70841 * gcc.dg/tree-ssa/pr70841.c: New test. gcc/ChangeLog: 2016-05-05 Kugan Vivekanandarajah

Re: [RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-05-04 Thread kugan
anted. Does this now look better? Thanks, Kugan diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr63586-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr63586-2.c index e69de29..0dcfe32 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr63586-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr63586-2.c @@ -0,0 +1,32 @@ +/* {

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-05-04 Thread kugan
tion. Please also add a testcase that catches (-y) * x * (-z). Added this to the testcase. Does this look better now? Thanks, Kugan 2016-04-23 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/40921 * gcc.dg/tree-ssa/pr40921.c: New test. gcc/Chang

Re: [RFC][PR68217] Improve value range for signed & sign-bit-CST

2016-04-26 Thread kugan
On 27/04/16 00:14, Richard Biener wrote: On Fri, Apr 15, 2016 at 12:44 PM, kugan <kugan.vivekanandara...@linaro.org> wrote: As pointed out by Richard, for signed & sign-bit-CST value range should be [-INF, 0] range, not a [-INF, INF] range as happens now. This patch fix

Re: [RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-04-23 Thread kugan
wise with complex or vector math. Btw, does it handle associating x + 3 * x + x to 5 * x ? Added this to the testcase and verified it is working. Regression tested and bootstrapped on x86-64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/testsuite/C

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-04-23 Thread kugan
uot;last"). Hi Richard, Thanks. Here is an attempt which does this. Regression tested and bootstrapped on x86-64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan 2016-04-23 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/40921

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-04-21 Thread kugan
Hi Richard, On 19/04/16 22:11, Richard Biener wrote: On Tue, Apr 19, 2016 at 1:36 PM, Richard Biener <richard.guent...@gmail.com> wrote: On Tue, Apr 19, 2016 at 1:35 PM, Richard Biener <richard.guent...@gmail.com> wrote: On Mon, Feb 29, 2016 at 11:53 AM, kugan <kuga

[RFC][PR61839]Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) : (CST BINOP 0)

2016-04-16 Thread kugan
ession tested for x86-64-linux-gnu with no new regression. Is this OK for statege-1. Thanks, Kugan gcc/ChangeLog: 2016-04-17 Kugan Vivekanandarajah <kug...@linaro.org> * tree-vrp.c (simplify_stmt_using_ranges): Convert CST BINOP COND_EXPR to COND_EXPR ? (CST BINOP 1) :

[RFC][PR68217] Improve value range for signed & sign-bit-CST

2016-04-15 Thread kugan
As pointed out by Richard, for signed & sign-bit-CST value range should be [-INF, 0] range, not a [-INF, INF] range as happens now. This patch fixes this. I bootstrapped and regression tested for x86-64-linux-gnu with no new regression. Is this OK for statege-1. Thanks, Kugan gcc/Chang

Re: [PATCH ARM v2] PR69770 -mlong-calls does not affect calls to __gnu_mcount_nc generated by -pg

2016-03-28 Thread Kugan
hen stage 1 re-opens. > Hi Charles, +static void +arm_emit_long_call_profile_insn () +{ + rtx sym_ref = gen_rtx_SYMBOL_REF (Pmode, "__gnu_mcount_nc"); + /* if movt/movw are not available, use a constant pool */ + if (!arm_arch_thumb2) Should this be !TARGET_USE_MOVT? Thanks, Kugan

Re: [RFC][PR69708] IPA inline not working for function reference in static const struc

2016-03-10 Thread kugan
On 11/03/16 03:39, Martin Jambor wrote: Hi, On Tue, Mar 01, 2016 at 09:04:25AM +1100, kugan wrote: Hi, As discussed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69708 and corresponding mailing list discussion, IPA CP is not detecting a jump-function with the sq function as value

[RFC][PR69708] IPA inline not working for function reference in static const struc

2016-02-29 Thread kugan
added a check at determine_locally_known_aggregate_parts to detect this. This fixes the testcase and passes x86-64-linux-gnu lto bootstrap and regression testing with no new regression. Does this look sensible place to fix this? Thanks, Kugan gcc/ChangeLog: 2016-03-01 Kugan Vivekanandarajah

Re: [RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-02-29 Thread kugan
pdated patch along what you suggested. Does this look better ? Thanks, Kugan diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 17eb64f..bbb5ffb 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -4674,6 +4674,41 @@ attempt_builtin_powi (gimple *stmt, vec *ops)

Re: [RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-02-28 Thread kugan
modification to the ops vector. Hi Richard, Is the attached patch looks better? Thanks, Kugan diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr63586.c b/gcc/testsuite/gcc.dg/tree-ssa/pr63586.c index e69de29..a002bdd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr63586.c +++ b/gcc/testsuite/gcc.dg/tree-ssa

[RFC][PATCH][PR63586] Convert x+x+x+x into 4*x

2016-02-25 Thread kugan
Hi, This is an attempt to fix missed optimization: x+x+x+x -> 4*x as reported in PR63586. Regression tested and bootstrapped on x86-64-linux-gnu with no new regressions. Is this OK for next stage1? Thanks, Kugan gcc/testsuite/ChangeLog: 2016-02-26 Kugan Vivekanandarajah &

[RFC][PATCH][PR40921] Convert x + (-y * z * z) into x - y * z * z

2016-02-25 Thread kugan
Hi, This is an attempt to fix missed optimization: x + (-y * z * z) => x - y * z * z as reported in PR40921. Regression tested and bootstrapped on x86-64-linux-gnu with no new regressions. Is this OK for next stage1? Thanks, Kugan gcc/ChangeLog: 2016-02-26 Kugan Vivekanandara

Re: [PR66726] Fixe regression caused by Factor conversion out of COND_EXPR

2016-02-11 Thread kugan
On 12/02/16 17:18, Markus Trippelsdorf wrote: On 2016.02.08 at 09:49 -0700, Jeff Law wrote: On 01/18/2016 08:52 PM, Kugan wrote: 2016-01-19 Kugan Vivekanandarajah <kug...@linaro.org> PR middle-end/66726 * tree-ssa-reassoc.c (optimize_range_tests): Handle tcc_compar

Re: Incorrect code due to indirect tail call of varargs function with hard float ABI

2016-01-25 Thread Kugan
This issue also remains in 4.9 and 5.0 branches. Is this OK to backport to the release branches. Thanks, Kugan On 02/12/15 10:00, Kugan wrote: > >>> >>> gcc/ChangeLog: >>> >>> 2015-11-18 Kugan Vivekanandarajah <kug...@linaro.org> >>&

Remove redundant unshare_expr from ipa-prop

2016-01-21 Thread Kugan
Hi, There is a redundant unshare_expr in ipa-prop. Attached patch removes it. Bootstrapped and regression tested on x86_64-pc-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-01-22 Kugan Vivekanandarajah <kug...@linaro.org> * ipa-

<    1   2   3   4   5   6   >