Skip to content

Commit

Permalink
Add IPA VRP
Browse files Browse the repository at this point in the history
gcc/lto/ChangeLog:
2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* lto-partition.c: Include tree-vrp.h.
	* lto.c: Likewise.

gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments
	will be optimized away.
	* gcc.dg/ipa/vrp1.c: New test.
	* gcc.dg/ipa/vrp2.c: New test.
	* gcc.dg/ipa/vrp3.c: New test.

gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* common.opt: New option -fipa-vrp.
	* ipa-cp.c (ipa_get_vr_lat): New.
	(ipcp_vr_lattice::print): Likewise.
	(print_all_lattices): Call ipcp_vr_lattice::print.
	(ipcp_vr_lattice::meet_with): New.
	(ipcp_vr_lattice::meet_with_1): Likewise.
	(ipcp_vr_lattice::top_p): Likewise.
	(ipcp_vr_lattice::bottom_p): Likewsie.
	(ipcp_vr_lattice::set_to_bottom): Likewise.
	(set_all_contains_variable): Call VR set_to_bottom.
	(initialize_node_lattices): Init VR lattices.
	(propagate_vr_accross_jump_function): New.
	(propagate_constants_accross_call): Call
	propagate_vr_accross_jump_function.
	(ipcp_store_vr_results): New.
	(ipcp_driver): Handle VR.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR.
	(ipa_set_jf_unknown): Likewise.
	(ipa_compute_jump_functions_for_edge): Likewise.
	(ipa_node_params_t::duplicate): Likewise.
	(ipa_write_jump_function): Likewise.
	(ipa_read_jump_function): Likewise.
	(write_ipcp_transformation_info): Likewise.
	(read_ipcp_transformation_info): Likewise.
	(ipcp_update_vr): New.
	(ipcp_transform_function): Handle VR.
	* ipa-prop.h (struct ipa_vr): New.
	* cgraph.c: Include tree-vrp.h.
	* cgraphunit.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.

From-SVN: r240292
  • Loading branch information
Kugan Vivekanandarajah authored and Kugan Vivekanandarajah committed Sep 20, 2016
1 parent 973625a commit 8bc5448
Show file tree
Hide file tree
Showing 23 changed files with 599 additions and 7 deletions.
40 changes: 40 additions & 0 deletions gcc/ChangeLog
@@ -1,3 +1,43 @@
2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>

* common.opt: New option -fipa-vrp.
* ipa-cp.c (ipa_get_vr_lat): New.
(ipcp_vr_lattice::print): Likewise.
(print_all_lattices): Call ipcp_vr_lattice::print.
(ipcp_vr_lattice::meet_with): New.
(ipcp_vr_lattice::meet_with_1): Likewise.
(ipcp_vr_lattice::top_p): Likewise.
(ipcp_vr_lattice::bottom_p): Likewsie.
(ipcp_vr_lattice::set_to_bottom): Likewise.
(set_all_contains_variable): Call VR set_to_bottom.
(initialize_node_lattices): Init VR lattices.
(propagate_vr_accross_jump_function): New.
(propagate_constants_accross_call): Call
propagate_vr_accross_jump_function.
(ipcp_store_vr_results): New.
(ipcp_driver): Handle VR.
* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR.
(ipa_set_jf_unknown): Likewise.
(ipa_compute_jump_functions_for_edge): Likewise.
(ipa_node_params_t::duplicate): Likewise.
(ipa_write_jump_function): Likewise.
(ipa_read_jump_function): Likewise.
(write_ipcp_transformation_info): Likewise.
(read_ipcp_transformation_info): Likewise.
(ipcp_update_vr): New.
(ipcp_transform_function): Handle VR.
* ipa-prop.h (struct ipa_vr): New.
* cgraph.c: Include tree-vrp.h.
* cgraphunit.c: Likewise.
* ipa-utils.c: Likewise.
* ipa.c: Likewise.
* opts.c: Likewise.
* toplev.c: Likewise.
* ipa-devirt.c: Likewise.
* ipa-inline-transform.c: Likewise.
* ipa-inline.c: Likewise.
* ipa-profile.c: Likewise.

2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org>

* doc/invoke.texi: Document -fdump-tree-evrp.
Expand Down
1 change: 1 addition & 0 deletions gcc/cgraph.c
Expand Up @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "ipa-utils.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
#include "ipa-prop.h"
#include "ipa-inline.h"
#include "cfgloop.h"
Expand Down
1 change: 1 addition & 0 deletions gcc/cgraphunit.c
Expand Up @@ -190,6 +190,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "debug.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
#include "ipa-prop.h"
#include "gimple-pretty-print.h"
#include "plugin.h"
Expand Down
4 changes: 4 additions & 0 deletions gcc/common.opt
Expand Up @@ -1605,6 +1605,10 @@ fipa-struct-reorg
Common Ignore
Does nothing. Preserved for backward compatibility.

fipa-vrp
Common Report Var(flag_ipa_vrp) Optimization
Perform IPA Value Range Propagation.

fira-algorithm=
Common Joined RejectNegative Enum(ira_algorithm) Var(flag_ira_algorithm) Init(IRA_ALGORITHM_CB) Optimization
-fira-algorithm=[CB|priority] Set the used IRA algorithm.
Expand Down

0 comments on commit 8bc5448

Please sign in to comment.