diff mbox

Fix PR59715

Message ID 52CE91AE.1080504@mentor.com
State New
Headers show

Commit Message

Tom de Vries Jan. 9, 2014, 12:10 p.m. UTC
On 09-01-14 10:16, Richard Biener wrote:
>
> This fixes PR59715 by splitting critical edges again before
> code sinking.  The critical edge splitting done before PRE
> was designed to survive until sinking originally, but at least
> since 4.5 PRE now eventually cleans up the CFG and thus undos
> critical edge splitting.  This results in less than optimal
> code placement (and lost opportunities) for sinking and it
> breaks (at least) the virtual operand updating code which
> assumes that critical edges are still split.
>

Richard,

this follow-up patch:
- notes in pass_pre that PROP_no_crit_edge is destroyed
- notes in pass_sink_code that PROP_no_crit_edge is not required
   (because it's now ensured by the pass itself)

Build and reg-tested pr59715.c on x86_64.

OK for stage3 trunk if bootstrap and full reg-test on x86_64 is ok?

Thanks,
- Tom

Comments

Richard Biener Jan. 9, 2014, 12:33 p.m. UTC | #1
On Thu, 9 Jan 2014, Tom de Vries wrote:

> On 09-01-14 10:16, Richard Biener wrote:
> > 
> > This fixes PR59715 by splitting critical edges again before
> > code sinking.  The critical edge splitting done before PRE
> > was designed to survive until sinking originally, but at least
> > since 4.5 PRE now eventually cleans up the CFG and thus undos
> > critical edge splitting.  This results in less than optimal
> > code placement (and lost opportunities) for sinking and it
> > breaks (at least) the virtual operand updating code which
> > assumes that critical edges are still split.
> > 
> 
> Richard,
> 
> this follow-up patch:
> - notes in pass_pre that PROP_no_crit_edge is destroyed
> - notes in pass_sink_code that PROP_no_crit_edge is not required
>   (because it's now ensured by the pass itself)
> 
> Build and reg-tested pr59715.c on x86_64.
> 
> OK for stage3 trunk if bootstrap and full reg-test on x86_64 is ok?

Ok with /* PROP_no_crit_edges | */ not commented but removed.

Thanks,
Richard.
Tom de Vries Jan. 10, 2014, 3:45 p.m. UTC | #2
On 09-01-14 13:33, Richard Biener wrote:
> On Thu, 9 Jan 2014, Tom de Vries wrote:
>
>> On 09-01-14 10:16, Richard Biener wrote:
>>>
>>> This fixes PR59715 by splitting critical edges again before
>>> code sinking.  The critical edge splitting done before PRE
>>> was designed to survive until sinking originally, but at least
>>> since 4.5 PRE now eventually cleans up the CFG and thus undos
>>> critical edge splitting.  This results in less than optimal
>>> code placement (and lost opportunities) for sinking and it
>>> breaks (at least) the virtual operand updating code which
>>> assumes that critical edges are still split.
>>>
>>
>> Richard,
>>
>> this follow-up patch:
>> - notes in pass_pre that PROP_no_crit_edge is destroyed
>> - notes in pass_sink_code that PROP_no_crit_edge is not required
>>    (because it's now ensured by the pass itself)
>>
>> Build and reg-tested pr59715.c on x86_64.
>>
>> OK for stage3 trunk if bootstrap and full reg-test on x86_64 is ok?
>
> Ok with /* PROP_no_crit_edges | */ not commented but removed.
>

Richard,

Committed to trunk with that change.

I saw you propagated the fix for PR59715 to 4.8 and 4.7 as well.

Should I propagate this follow-up patch as well?

Thanks,
- Tom

> Thanks,
> Richard.
>
Richard Biener Jan. 12, 2014, 1:20 p.m. UTC | #3
On Fri, Jan 10, 2014 at 4:45 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 09-01-14 13:33, Richard Biener wrote:
>>
>> On Thu, 9 Jan 2014, Tom de Vries wrote:
>>
>>> On 09-01-14 10:16, Richard Biener wrote:
>>>>
>>>>
>>>> This fixes PR59715 by splitting critical edges again before
>>>> code sinking.  The critical edge splitting done before PRE
>>>> was designed to survive until sinking originally, but at least
>>>> since 4.5 PRE now eventually cleans up the CFG and thus undos
>>>> critical edge splitting.  This results in less than optimal
>>>> code placement (and lost opportunities) for sinking and it
>>>> breaks (at least) the virtual operand updating code which
>>>> assumes that critical edges are still split.
>>>>
>>>
>>> Richard,
>>>
>>> this follow-up patch:
>>> - notes in pass_pre that PROP_no_crit_edge is destroyed
>>> - notes in pass_sink_code that PROP_no_crit_edge is not required
>>>    (because it's now ensured by the pass itself)
>>>
>>> Build and reg-tested pr59715.c on x86_64.
>>>
>>> OK for stage3 trunk if bootstrap and full reg-test on x86_64 is ok?
>>
>>
>> Ok with /* PROP_no_crit_edges | */ not commented but removed.
>>
>
> Richard,
>
> Committed to trunk with that change.
>
> I saw you propagated the fix for PR59715 to 4.8 and 4.7 as well.
>
> Should I propagate this follow-up patch as well?

No, it's purely cosmetic after all.

Richard.

> Thanks,
> - Tom
>
>> Thanks,
>> Richard.
>>
>
diff mbox

Patch

2014-01-09  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-pre.c (pass_data_pre): Add comment about PROP_no_crit_edges
	in properties_required.  Add PROP_no_crit_edges to properties_destroyed.
	* tree-ssa-sink.c (pass_data_sink_code): Comment out PROP_no_crit_edges
	in PROP_no_crit_edges.

diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 2de5db5..1e55356 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4798,9 +4798,11 @@  const pass_data pass_data_pre =
   true, /* has_gate */
   true, /* has_execute */
   TV_TREE_PRE, /* tv_id */
+  /* PROP_no_crit_edges is ensured by placing pass_split_crit_edges before
+     pass_pre.  */
   ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
   0, /* properties_provided */
-  0, /* properties_destroyed */
+  PROP_no_crit_edges, /* properties_destroyed */
   TODO_rebuild_alias, /* todo_flags_start */
   TODO_verify_ssa, /* todo_flags_finish */
 };
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index a72a9e8..b56c4fe 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -604,7 +604,9 @@  const pass_data pass_data_sink_code =
   true, /* has_gate */
   true, /* has_execute */
   TV_TREE_SINK, /* tv_id */
-  ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
+  /* PROP_no_crit_edges is ensured by running split_critical_edges in
+     execute_sink_code.  */
+  ( /* PROP_no_crit_edges | */ PROP_cfg | PROP_ssa ), /* properties_required */
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */