Re: [PATCH] Preserve the original program while using graphite

2015-11-13 Thread Sebastian Pop
On Fri, Nov 13, 2015 at 3:08 PM, Tom de Vries  wrote:
> On 11/11/15 23:54, Aditya Kumar wrote:
>>
>> Earlier, graphite used to translate portions of the original program after
>> scop-detection in order to represent the SCoP into polyhedral model.  This
>> was
>> required because each basic block was represented as independent basic
>> block in
>> the polyhedral model. So all the cross-basic-block dependencies were
>> translated
>> out-of-ssa.
>>
>> With this patch those dependencies are also exposed to the ISL, so there
>> is no
>> need to modify the original structure of the program.
>>
>> After this patch we should be able to enable graphite at some default
>> optimization level.
>>
>>
>> Highlights:
>> Remove cross bb scalar to array translation
>> For reductions, add support for more than just INT_CST
>> Early bailout on codegen.
>> Verify loop-closed ssa structure during copy of renames
>> The uses of exprs should come from bb which dominates the bb
>> Collect the init value of close phi in loop-guard
>> Do not follow vuses for close-phi, postpone loop-close phi until the
>>  corresponding loop-phi is processed
>> Bail out if no bb found to place cond/loop -phis
>> Move insertion of liveouts at the end of codegen
>> Insert loop-phis in the loop-header.
>>
>>
>> This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2
>> -fgraphite-identity -floop-nest-optimize'
>>
>>
>
> This patch has been committed, and caused PR68341 - 'FAIL:
> gcc.dg/graphite/interchange-{1,11,13}.c (internal compiler error)'

We will work on fixing these issues.  I think they are related to the
ISL version.
We tested all our patches with ISL 0.15 with which they are all passing.
I still have in my todo list to disable all ISL versions strictly
lower than 0.14.
We will fix the problems with ISL 0.14.

If possible, I would like to deprecate ISL 0.14 in this release,
such that we can remove support for ISL 0.14 in the next 7.x release.
We highly recommend configuring GCC with ISL 0.15.

Thanks,
Sebastian

Thanks,
Sebastian

>
> Thanks,
> - Tom


Re: [PATCH] Preserve the original program while using graphite

2015-11-13 Thread Tom de Vries

On 11/11/15 23:54, Aditya Kumar wrote:

Earlier, graphite used to translate portions of the original program after
scop-detection in order to represent the SCoP into polyhedral model.  This was
required because each basic block was represented as independent basic block in
the polyhedral model. So all the cross-basic-block dependencies were translated
out-of-ssa.

With this patch those dependencies are also exposed to the ISL, so there is no
need to modify the original structure of the program.

After this patch we should be able to enable graphite at some default
optimization level.


Highlights:
Remove cross bb scalar to array translation
For reductions, add support for more than just INT_CST
Early bailout on codegen.
Verify loop-closed ssa structure during copy of renames
The uses of exprs should come from bb which dominates the bb
Collect the init value of close phi in loop-guard
Do not follow vuses for close-phi, postpone loop-close phi until the
 corresponding loop-phi is processed
Bail out if no bb found to place cond/loop -phis
Move insertion of liveouts at the end of codegen
Insert loop-phis in the loop-header.


This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 
-fgraphite-identity -floop-nest-optimize'




This patch has been committed, and caused PR68341 - 'FAIL: 
gcc.dg/graphite/interchange-{1,11,13}.c (internal compiler error)'


Thanks,
- Tom


[PATCH] Preserve the original program while using graphite

2015-11-11 Thread Aditya Kumar
Earlier, graphite used to translate portions of the original program after
scop-detection in order to represent the SCoP into polyhedral model.  This was
required because each basic block was represented as independent basic block in
the polyhedral model. So all the cross-basic-block dependencies were translated
out-of-ssa.

With this patch those dependencies are also exposed to the ISL, so there is no
need to modify the original structure of the program.

After this patch we should be able to enable graphite at some default
optimization level.


Highlights:
Remove cross bb scalar to array translation
For reductions, add support for more than just INT_CST
Early bailout on codegen.
Verify loop-closed ssa structure during copy of renames
The uses of exprs should come from bb which dominates the bb
Collect the init value of close phi in loop-guard
Do not follow vuses for close-phi, postpone loop-close phi until the
corresponding loop-phi is processed
Bail out if no bb found to place cond/loop -phis
Move insertion of liveouts at the end of codegen
Insert loop-phis in the loop-header.


This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 
-fgraphite-identity -floop-nest-optimize'


>From 706df301cdc8d2523408c663f62383308bc8a642 Mon Sep 17 00:00:00 2001
From: Aditya Kumar 
Date: Sat, 7 Nov 2015 13:39:23 -0600
Subject: [PATCH] Preserve the original program while using graphite.

Earlier, graphite used to translate portions of the original program after
scop-detection in order to represent the SCoP into polyhedral model.  This was
required because each basic block was represented as independent basic block in
the polyhedral model. So all the cross-basic-block dependencies were translated
out-of-ssa.

With this patch those dependencies are also exposed to the ISL, so there is no
need to modify the original structure of the program.

After this patch we should be able to enable graphite at some default
optimization level.


Highlights:
Remove cross bb scalar to array translation
For reductions, add support for more than just INT_CST
Early bailout on codegen.
Verify loop-closed ssa structure during copy of renames
The uses of exprs should come from bb which dominates the bb
Collect the init value of close phi in loop-guard
Do not follow vuses for close-phi, postpone loop-close phi until the
corresponding loop-phi is processed
Bail out if no bb found to place cond/loop -phis
Move insertion of liveouts at the end of codegen
Insert loop-phis in the loop-header.


This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize'


2015-11-08  Aditya Kumar  
  Sebastian Pop  

	* gcc.dg/graphite/isl-ast-gen-user-1.c: Remove calls to std. library.

gcc/ChangeLog:

2015-11-08  Aditya Kumar  
  Sebastian Pop  

	* graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple):
	  New member codegen_error
	(translate_isl_ast_for_loop): Remove call to single_succ_edge and early return.
	(translate_isl_ast_node_user): Early return in case of error.
	(translate_isl_ast_to_gimple::translate_isl_ast): Same.
	(translate_isl_ast_to_gimple::translate_pending_phi_nodes): New.
	(add_parameters_to_ivs_params): Remove macro.
	(graphite_regenerate_ast_isl): Add if_region pointer to region.
	* graphite-poly.c (new_poly_dr): Remove macro.
	(print_pdr): Same.
	(new_gimple_poly_bb): Same.
	(free_gimple_poly_bb): Same.
	(print_scop_params): Same.
	* graphite-poly.h (struct poly_dr): Same.
	(struct poly_bb): Add new_bb.
	(gbb_from_bb): Remove dead code.
	(pbb_from_bb): Same. 
	* graphite-scop-detection.c (parameter_index_in_region_1): Same.
	(parameter_index_in_region): Same.
	(find_scop_parameters): Same.
	(build_cross_bb_scalars_def): New.
	(build_cross_bb_scalars_use): New.
	(graphite_find_cross_bb_scalar_vars): New
	(try_generate_gimple_bb): Reads and Writes.
	(build_alias_set): Move.
	(gather_bbs::before_dom_children): Gather bbs visited.
	(build_scops): call build_alias_set.
	* graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete.
	(remove_simple_copy_phi): Delete.
	(remove_invariant_phi): Delete.
	(simple_copy_phi_p): Delete.
	(reduction_phi_p): Delete.
	(isl_id_for_dr): Remove unused param.
	(parameter_index_in_region_1): Remove macro usage.
	(set_scop_parameter_dim): Same.
	(add_param_constraints): Same.
	(add_conditions_to_constraints): Same
	(build_scop_iteration_domain): Same.
	(pdr_add_alias_set): Comment.
	(add_scalar_version_numbers): New.
	(build_poly_dr): ISL id.
	(build_scop_drs): Move.
	(build_poly_sr_1): Same.
	(insert_stmts): Remove.
	(build_poly_sr): New.
	(new_pbb_from_pbb): Delete.
	(insert_out_of_ssa_copy_on_edge): Delete.
	(create_zero_dim_array): Delete.
	(scalar_close_phi_node_p): Delete.
	(propagate_expr_outside_region): Delete.
	(rewrite_close_phi_out_of_ssa): Delete.
	(rewrite_phi_out_of_ssa): Delete.
	(rewrite_degenerate_phi): Delete.
	(rewrite_reductions_out_of_ssa): Delete.
	(rewrite_cross_bb_sca

[PATCH] Preserve the original program while using graphite.

2015-11-08 Thread aditya kumar
Earlier, graphite used to translate portions of the original program after
scop-detection in order to represent the SCoP into polyhedral model.
This was required because each basic block was represented as independent
basic block in the polyhedral model. So all the cross-basic-block dependencies
were translated out-of-ssa.
With this patch those dependencies are also exposed to the ISL, so there
is no need to modify the original structure of the program. There is still
a little bit of work required but we are posting it before the stage 1 closes.
The complete patch would be ready in a few days.

After this patch we should be able to enable graphite at some default
optimization level.

The patch is attached:

Aditya Kumar
Compiler Engineer


0001-Preserve-the-original-program-while-running-graphite.patch
Description: Binary data