[PATCH] Proposal for IPA init() constant propagation

2019-11-15 Thread erick . ochoa
?id=92538 2019-11-15 Erick Ochoa Proposal for IPA init() constant propagation * gcc/Makefile.in: Add pass to the build process * gcc/cgraph.c: Add assertion. * gcc/common.opt: Add pass * gcc/ipa-initcall-cp.c: new * gcc/passes.def: Place pass

Re: [PATCH] Proposal for IPA init() constant propagation

2020-01-23 Thread Erick Ochoa
Forgot to attach the test cases. On 2020-01-23 10:20 a.m., Erick Ochoa wrote: > Hi Jan, > > Here is a patch I just rebased against > > commit 2589beb1d1a065f75a5515c9e2698de12a421913 (origin/master, origin/HEAD, > master) > Author: GCC Administrator > Date: Sun Ja

Re: [PATCH] Proposal for IPA init() constant propagation

2020-01-23 Thread Erick Ochoa
Hi Jan, Here is a patch I just rebased against commit 2589beb1d1a065f75a5515c9e2698de12a421913 (origin/master, origin/HEAD, master) Author: GCC Administrator Date: Sun Jan 19 00:16:30 2020 + I also include some test cases. To run test cases, just set your path for the gcc executable

[PATCH] Update documentation on optimizations turned on by O3

2020-04-22 Thread Erick Ochoa
Hello, I noted that the optimizations turned on by O3 was outdated in the documentation. Here is the discussion that brought it to my attention: https://gcc.gnu.org/pipermail/gcc/2020-April/232164.html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e2bc2559218..a28001a5adf

[PATCH] Fixes documentation for gimple_assign functions

2020-05-16 Thread Erick Ochoa
Fixes documentation for gimple_assign functions This patch corrects the documented function signatures of gimple_assign* functions. ChangeLog: 2020-05-16 Erick Ochoa * gcc/gimple.h (gimple_assign_rhs_code): Fix signature (gimple_assign_rhs_class): same

[PATCH] Adds wrapper for gimple_return_retval to accept gimple*

2020-05-16 Thread Erick Ochoa
. The wrapper takes gimple* as arguments. ChangeLog: 2020-05-16 Erick Ochoa * gcc/gimple.h (gimple_return_retval): New function (gimple_return_retval_ptr): same (gimple_return_set_retval): same * gcc/gimple.texi (gimple_return_retval): Fix documentation

Re: [PATCH] Fixes documentation for gimple_assign functions

2020-05-18 Thread Erick Ochoa
wrote: On May 16, 2020 11:42:02 AM GMT+02:00, Erick Ochoa wrote: Fixes documentation for gimple_assign functions This patch corrects the documented function signatures of gimple_assign* functions. OK. Richard. ChangeLog: 2020-05-16 Erick Ochoa * gcc/gimple.h

[PATCH] tree-ssa-structalias.c: Fix comments

2020-05-06 Thread Erick Ochoa
This patch fixes some quotations inside comments. The change in syntax highlighting was bothering me. I also found a typo. ChangeLog: 2020-05-06 Erick Ochoa * gcc/tree-ssa-struct-alias.c: Fix comments diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index

[PATCH 1/5] Add stringify_ipa_ref_use function.

2020-05-29 Thread Erick Ochoa
--- gcc/ipa-ref.c | 22 ++ gcc/ipa-ref.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/gcc/ipa-ref.c b/gcc/ipa-ref.c index 241828ee973..76459e9cc3d 100644 --- a/gcc/ipa-ref.c +++ b/gcc/ipa-ref.c @@ -103,3 +103,25 @@ ipa_ref::referred_ref_list (void) {

[PATCH 2/5] Add function tree_code_in_cst.

2020-05-29 Thread Erick Ochoa
--- gcc/tree.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/gcc/tree.h b/gcc/tree.h index bd0c51b2a18..86a4542f58b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -6156,6 +6156,17 @@ int_bit_position (const_tree field) + wi::to_offset (DECL_FIELD_BIT_OFFSET

[patch 0/5] ipa-initcall-cp

2020-05-29 Thread Erick Ochoa
Hello everyone, I wanted to highlight this ticket on bugzilla [0]. It is a missed optimization that I worked on. It involves propagating constants across function calls at link-time. I am relatively new to GCC and this would be my first significant contribution. I have developed a prototype

[PATCH 5/5] Adds ipa-initcall-cp pass.

2020-05-29 Thread Erick Ochoa
This pass is a variant of constant propagation where global primitive constants with a single write are propagated to multiple read statements. ChangeLog: 2020-05-20 Erick Ochoa gcc/Makefile.in: Adds new pass gcc/passes.def: Same gcc/tree-pass.h: Same gcc

[PATCH 4/5] Export cgraph_externally_visible_p.

2020-05-29 Thread Erick Ochoa
--- gcc/ipa-ref.h| 2 +- gcc/ipa-visibility.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/ipa-ref.h b/gcc/ipa-ref.h index 95e29605548..9ff26e2693c 100644 --- a/gcc/ipa-ref.h +++ b/gcc/ipa-ref.h @@ -139,5 +139,5 @@ public: const char *

[PATCH 3/5] Add function path_exists

2020-05-29 Thread Erick Ochoa
--- gcc/ipa-utils.c | 33 + gcc/ipa-utils.h | 4 +++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index 23e7f714306..bd3e79bd2e2 100644 --- a/gcc/ipa-utils.c +++ b/gcc/ipa-utils.c @@ -781,3 +781,36 @@

Re: [PATCH 2/5] Add function tree_code_in_cst.

2020-06-02 Thread Erick Ochoa
On 02/06/2020 14:29, Richard Biener wrote: On Sat, May 30, 2020 at 12:18 AM Jan Hubicka wrote: --- gcc/tree.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/gcc/tree.h b/gcc/tree.h index bd0c51b2a18..86a4542f58b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -6156,6

[PATCH 8/8 v4] The Great STL migration

2020-12-04 Thread Erick Ochoa
--- gcc/ipa-dfe.c | 262 +++--- gcc/ipa-dfe.h | 108 +++--- gcc/ipa-field-reorder.c| 134 +++ gcc/ipa-type-escape-analysis.c | 636 - gcc/ipa-type-escape-analysis.h | 160 - 5 files changed, 643

[PATCH 6/8 v4] Add heuristic to take into account void* pattern.

2020-12-04 Thread Erick Ochoa
then we color the nodes in the call graph as "casts are safe in this function and does not call external visible functions". We propagate this property up the callgraph until a fixed point is reached. This will later be changed to use ipa-modref. 2020-11-04 Erick Ochoa * ipa-t

[PATCH 7/8 v4] Add tests

2020-12-04 Thread Erick Ochoa
--- gcc/common.opt| 4 ++ gcc/ipa-type-escape-analysis.c| 11 + .../ipa/ipa-access-counter-00-simple-read-0.c | 22 ++ .../ipa-access-counter-01-simple-write-0.c| 22 ++ .../ipa-access-counter-02-pointer-read-0.c| 22

[PATCH 5/8 v4] Abort if Gimple from C++ or Fortran sources is found.

2020-12-04 Thread Erick Ochoa
2020-11-04 Erick Ochoa * ipa-field-reorder: Add flag to exit transformation. * ipa-type-escape-analysis: Same. --- gcc/ipa-field-reorder.c| 3 +- gcc/ipa-type-escape-analysis.c | 54 -- gcc/ipa-type-escape-analysis.h | 2 ++ 3 files changed

[PATCH 1/8 v4] Dead-field warning in structs at LTO-time

2020-12-04 Thread Erick Ochoa
of the current linking unit (e.g. parameter types of external functions). The field access analyses non-escaping structs for fields that are not used in the linking unit and thus can be removed. 2020-11-04 Erick Ochoa * Makefile.in: Add file to list of new sources. * common.opt: Add new

[PATCH 2/8 v4] Add Dead Field Elimination

2020-12-04 Thread Erick Ochoa
Using the Dead Field Analysis, Dead Field Elimination automatically transforms gimple to eliminate fields that are never read. 2020-11-04 Erick Ochoa * Makefile.in: Add file to list of sources. * ipa-dfe.c: New. * ipa-dfe.h: Same. * ipa-type-escape-analysis.h: Export code

[PATCH 3/8 v4] Add Field Reordering

2020-12-04 Thread Erick Ochoa
Field reordering of structs at link-time 2020-11-04 Erick Ochoa * Makefile.in: Add new file to list of sources. * common.opt: Add new flag for field reordering. * passes.def: Add new pass. * tree-pass.h: Same. * ipa-field-reorder.c: New file. * ipa-type-escape

[PATCH 4/8 v4] Add documentation for dead field elimination

2020-12-04 Thread Erick Ochoa
2020-11-04 Erick Ochoa * Makefile.in: Add file to documentation sources. * doc/dfe.texi: New section. * doc/gccint.texi: Include new section. --- gcc/Makefile.in | 3 +- gcc/doc/dfe.texi| 187 gcc/doc/gccint.texi | 2 + 3

[PATCH 0/8 v4] LTO Dead Field Elimination and Field Reordering

2020-12-04 Thread Erick Ochoa
Hello, I'm sharing the most recent version of dead-field elimination. In this patchset the following issues have been addressed: * CamelCase -> snake_case * STL -> GCC specific data structures * Fixed the commit messages (the last two commits will be squashed in future patchset so the commit

Re: [PATCH 1/8 v4] Dead-field warning in structs at LTO-time

2020-12-10 Thread Erick Ochoa
On 10/12/2020 18:39, David Malcolm wrote: On Fri, 2020-12-04 at 10:58 +0100, Erick Ochoa wrote: + // Anonymous fields? (Which the record can be!). + warning (OPT_Wdfa, "RECORD_TYPE %qE has dead field %qE in LTO.\n", + record, field); Others have p

Re: [PATCH 2/6 v3] Add Dead Field Elimination

2020-11-11 Thread Erick Ochoa
On 11.11.20 03:25, Jakub Jelinek wrote: On Wed, Nov 11, 2020 at 03:14:59AM -0800, Erick Ochoa wrote: Using the Dead Field Analysis, Dead Field Elimination automatically transforms gimple to eliminate fields that are never read. 2020-11-04 Erick Ochoa * gcc/Makefile.in: add file

[PATCH 3/6 v3] Add Field Reordering

2020-11-11 Thread Erick Ochoa
Field reordering of structs at link-time 2020-11-04 Erick Ochoa * gcc/Makefile.in: add new file to list of sources * gcc/common.opt: add new flag for field reordering * gcc/passes.def: add new pass * gcc/tree-pass.h: same * gcc/ipa-field-reorder.c: New file * gcc

[PATCH 2/6 v3] Add Dead Field Elimination

2020-11-11 Thread Erick Ochoa
Using the Dead Field Analysis, Dead Field Elimination automatically transforms gimple to eliminate fields that are never read. 2020-11-04 Erick Ochoa * gcc/Makefile.in: add file to list of sources * gcc/ipa-dfe.c: New * gcc/ipa-dfe.h: Same * gcc/ipa-type-escape-analysis.h

[PATCH 4/6 v3] Add documentation for dead field elimination

2020-11-11 Thread Erick Ochoa
2020-11-04 Erick Ochoa * gcc/Makefile.in: Add file to documentation sources * gcc/doc/dfe.texi: New section * gcc/doc/gccint.texi: Include new section --- gcc/Makefile.in | 3 +- gcc/doc/dfe.texi| 187 gcc/doc/gccint.texi

[PATCH 5/6 v3] Abort if Gimple from C++ or Fortran sources is found.

2020-11-11 Thread Erick Ochoa
2020-11-04 Erick Ochoa * gcc/ipa-field-reorder: Add flag to exit transformation * gcc/ipa-type-escape-analysis: Same --- gcc/ipa-field-reorder.c| 3 +- gcc/ipa-type-escape-analysis.c | 54 -- gcc/ipa-type-escape-analysis.h | 2 ++ 3 files

[PATCH 6/6 v3] Add heuristic to take into account void* pattern.

2020-11-11 Thread Erick Ochoa
then we color the nodes in the call graph as "casts are safe in this function and does not call external visible functions". We propagate this property up the callgraph until a fixed point is reached. This will later be changed to use ipa-modref. 2020-11-04 Erick Ochoa * ipa-t

[3/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From 91947eea01a41bd7b17e501ad7d53dfb6499eefc Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Sun, 9 Aug 2020 10:22:49 +0200 Subject: [PATCH 3/7] Add Field Reordering Field reordering of structs at link-time 2020-11-04 Erick Ochoa * gcc/Makefile.in: add new file to list of sources

[4/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From a8c4d5b99d5c4168ede79054396cba514fdf23b5 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Mon, 10 Aug 2020 09:10:37 +0200 Subject: [PATCH 4/7] Add documentation for dead field elimination 2020-11-04 Erick Ochoa * gcc/Makefile.in: Add file to documentation sources * gcc

[0/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
Hi, I've been working on several implementations of data layout optimizations for GCC, and I am again kindly requesting for a review of the type escape based dead field elimination and field reorg. This patchset is organized in the following way: * Adds a link-time warning if dead fields

[6/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From 1609f4713b6d0ab2e84e52b4fbd6f645f10a95e7 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Fri, 16 Oct 2020 08:49:08 +0200 Subject: [PATCH 6/7] Add heuristic to take into account void* pattern. We add a heuristic in order to be able to transform functions which receive void* arguments

[5/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From bad08833616e9dd7a212e55b93503200393da942 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Sun, 30 Aug 2020 10:21:35 +0200 Subject: [PATCH 5/7] Abort if Gimple produced from C++ or Fortran sources is found. 2020-11-04 Erick Ochoa * gcc/ipa-field-reorder: Add flag to exit

[7/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From 747b13bf2c6f5b17bc46316998f01483f8039548 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Wed, 4 Nov 2020 13:42:35 +0100 Subject: [PATCH 7/7] Getting rid of warnings 2020-11-04 Erick Ochoa * gcc/ipa-dfe.c : Change const_tree to tree * gcc/ipa-dfe.h : same * gcc

[2/7] LTO Dead field elimination and field reordering

2020-11-04 Thread Erick Ochoa
From 09feb1cc82a5d9851a6b524e37c32554b923b1c4 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Thu, 6 Aug 2020 14:07:20 +0200 Subject: [PATCH 2/7] Add Dead Field Elimination Using the Dead Field Analysis, Dead Field Elimination automatically transforms gimple to eliminate fields that are never

[PATCH 2/6] Add Dead Field Elimination

2020-11-06 Thread Erick Ochoa
From 2cd94824269e94babedd2a963e4b9ee96889ec82 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Thu, 6 Aug 2020 14:07:20 +0200 Subject: [PATCH 2/6] Add Dead Field Elimination Using the Dead Field Analysis, Dead Field Elimination automatically transforms gimple to eliminate fields that are never

[PATCH 0/6] Dead Field Elimination and Field Reorder

2020-11-06 Thread Erick Ochoa
Just submitting changes to the previously submitted patches. * I have removed all non-essential flags I introduced * I have placed the standard headers before config * I have squashed some changes that I sent to the patches mailing list and make sure that the transformation bootstraps on every

[PATCH 3/6] Add Field Reordering

2020-11-06 Thread Erick Ochoa
From 72e6ea57b04ca2bf223faef262b478dc407cdca7 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Sun, 9 Aug 2020 10:22:49 +0200 Subject: [PATCH 3/6] Add Field Reordering Field reordering of structs at link-time 2020-11-04 Erick Ochoa * gcc/Makefile.in: add new file to list of sources

[PATCH 6/6] Add heuristic to take into account void* pattern.

2020-11-06 Thread Erick Ochoa
From ccd82a7e484d9e4562c23f1b9cbebf3f47e2a822 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Fri, 16 Oct 2020 08:49:08 +0200 Subject: [PATCH 6/6] Add heuristic to take into account void* pattern. We add a heuristic in order to be able to transform functions which receive void* arguments

[PATCH 5/6] Abort if Gimple from C++ or Fortran sources is found.

2020-11-06 Thread Erick Ochoa
From f5dbfa73962d5443013d0193b2f91ea112a6d2d1 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Sun, 30 Aug 2020 10:21:35 +0200 Subject: [PATCH 5/6] Abort if Gimple from C++ or Fortran sources is found. 2020-11-04 Erick Ochoa * gcc/ipa-field-reorder: Add flag to exit transformation

[PATCH 4/6] Add documentation for dead field elimination

2020-11-06 Thread Erick Ochoa
From 015634bee522cf6224b0d4bcfd3adaf3a6a38fa0 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Mon, 10 Aug 2020 09:10:37 +0200 Subject: [PATCH 4/6] Add documentation for dead field elimination 2020-11-04 Erick Ochoa * gcc/Makefile.in: Add file to documentation sources * gcc/doc