public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* move increase_alignment from simple to regular ipa pass
@ 2016-06-01 10:17 Prathamesh Kulkarni
  2016-06-01 13:07 ` Richard Biener
  0 siblings, 1 reply; 26+ messages in thread
From: Prathamesh Kulkarni @ 2016-06-01 10:17 UTC (permalink / raw)
  To: Richard Biener, gcc Patches

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

Hi Richard,
This patch tries to move increase_alignment pass from small to regular ipa pass.
Does the patch look correct ?
Since we are only increasing alignment of varpool nodes, I am not sure
if any ipa
read/write hooks were necessary and passed NULL for them.
Cross-tested on arm*-*-*, aarch64*-*-*,
Bootstrap+test on aarch64-linux-gnu in progress.

Thanks,
Prathamesh

[-- Attachment #2: ias2r-1.diff --]
[-- Type: text/plain, Size: 2747 bytes --]

diff --git a/gcc/passes.def b/gcc/passes.def
index 993ed28..a841183 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -138,12 +138,12 @@ along with GCC; see the file COPYING3.  If not see
   PUSH_INSERT_PASSES_WITHIN (pass_ipa_tree_profile)
       NEXT_PASS (pass_feedback_split_functions);
   POP_INSERT_PASSES ()
-  NEXT_PASS (pass_ipa_increase_alignment);
   NEXT_PASS (pass_ipa_tm);
   NEXT_PASS (pass_ipa_lower_emutls);
   TERMINATE_PASS_LIST (all_small_ipa_passes)
 
   INSERT_PASSES_AFTER (all_regular_ipa_passes)
+  NEXT_PASS (pass_ipa_increase_alignment);
   NEXT_PASS (pass_ipa_whole_program_visibility);
   NEXT_PASS (pass_ipa_profile);
   NEXT_PASS (pass_ipa_icf);
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 66e103a..2d2e8fc 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -482,7 +482,7 @@ extern simple_ipa_opt_pass *make_pass_local_optimization_passes (gcc::context *c
 
 extern ipa_opt_pass_d *make_pass_ipa_whole_program_visibility (gcc::context
 							       *ctxt);
-extern simple_ipa_opt_pass *make_pass_ipa_increase_alignment (gcc::context
+extern ipa_opt_pass_d *make_pass_ipa_increase_alignment (gcc::context
 							      *ctxt);
 extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt);
 extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt);
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 2669813..aeb5e0f 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -938,7 +938,7 @@ namespace {
 
 const pass_data pass_data_ipa_increase_alignment =
 {
-  SIMPLE_IPA_PASS, /* type */
+  IPA_PASS, /* type */
   "increase_alignment", /* name */
   OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
   TV_IPA_OPT, /* tv_id */
@@ -949,11 +949,20 @@ const pass_data pass_data_ipa_increase_alignment =
   0, /* todo_flags_finish */
 };
 
-class pass_ipa_increase_alignment : public simple_ipa_opt_pass
+class pass_ipa_increase_alignment : public ipa_opt_pass_d
 {
 public:
   pass_ipa_increase_alignment (gcc::context *ctxt)
-    : simple_ipa_opt_pass (pass_data_ipa_increase_alignment, ctxt)
+    : ipa_opt_pass_d (pass_data_ipa_increase_alignment, ctxt,
+			   NULL, /* generate_summary  */
+			   NULL, /* write summary  */
+			   NULL, /* read summary  */
+			   NULL, /* write optimization summary  */
+			   NULL, /* read optimization summary  */
+			   NULL, /* stmt fixup  */
+			   0, /* function_transform_todo_flags_start  */
+			   NULL, /* transform function  */
+			   NULL )/* variable transform  */
   {}
 
   /* opt_pass methods: */
@@ -968,7 +977,7 @@ public:
 
 } // anon namespace
 
-simple_ipa_opt_pass *
+ipa_opt_pass_d *
 make_pass_ipa_increase_alignment (gcc::context *ctxt)
 {
   return new pass_ipa_increase_alignment (ctxt);

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: move increase_alignment from simple to regular ipa pass
@ 2016-06-02 12:52 David Edelsohn
  2016-06-02 12:57 ` Richard Biener
  0 siblings, 1 reply; 26+ messages in thread
From: David Edelsohn @ 2016-06-02 12:52 UTC (permalink / raw)
  To: Prathamesh Kulkarni, Richard Biener
  Cc: GCC Patches, Jan Hubicka, William J. Schmidt, Segher Boessenkool

>>>>> Richard Biener wrote:

>> "This would mean the pass should get its own non-Optimization flag
>> initialized by targets where section anchors are usually used"
>> IIUC should we add a new option -fno-increase_alignment and gate the
>> pass on it ? Um sorry I didn't understand why targets
>> with section anchors (arm, aarch64, ppc) should initialize this option ?
>
> Currently the pass is only run for targets with section anchors (and there
> by default if they are enabled by default).  So it makes sense to
> run on those by default and the pass is not necessary on targets w/o
> section anchors as the vectorizer can easily adjust alignment itself on
> those.

PPC does not always enable section anchors -- it depends on the code
model.  Shouldn't this be tied to use of section anchors?

Thanks, David

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-07-20 11:49 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-01 10:17 move increase_alignment from simple to regular ipa pass Prathamesh Kulkarni
2016-06-01 13:07 ` Richard Biener
2016-06-02  7:29   ` Prathamesh Kulkarni
2016-06-02  7:53     ` Richard Biener
2016-06-02  9:15       ` Prathamesh Kulkarni
2016-06-02  9:24         ` Prathamesh Kulkarni
2016-06-02 12:52 David Edelsohn
2016-06-02 12:57 ` Richard Biener
2016-06-02 15:01   ` Jan Hubicka
2016-06-03  7:57     ` Richard Biener
2016-06-03  8:05       ` Jan Hubicka
2016-06-07  8:34         ` Prathamesh Kulkarni
2016-06-08 14:15           ` Richard Biener
2016-06-08 15:09             ` Jan Hubicka
2016-06-09 20:18               ` Prathamesh Kulkarni
2016-06-09 20:23                 ` Jan Hubicka
2016-06-10  9:33                   ` Prathamesh Kulkarni
2016-06-10 11:17                     ` Richard Biener
2016-06-13  8:57                       ` Prathamesh Kulkarni
2016-06-13 10:43                         ` Jan Hubicka
2016-06-14 13:02                           ` Prathamesh Kulkarni
2016-06-17 14:22                             ` Prathamesh Kulkarni
2016-06-23 17:21                               ` Prathamesh Kulkarni
2016-06-28  9:27                                 ` Prathamesh Kulkarni
2016-07-05  9:53                                   ` Prathamesh Kulkarni
2016-07-20 11:49                                     ` Prathamesh Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).