diff mbox

bit of cleanup to graphite files

Message ID 55A02F6A.1030602@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod July 10, 2015, 8:47 p.m. UTC
I noticed a few annoying bits around the graphite files that I decided 
to cleanup.

- omega.h shouldn't include "config.h".  including params.h is fine 
since it is needed, but it should be within the #ifndef GCC_OMEGA_H guard.
- sese.h is required for compilation of graphite-poly.h, and basically 
isn't used anywhere else (except sese.c) , so simply include it in 
graphite-poly.h.
- I adjusted the rest of the graphite files . All but graphite.c guard 
the enter contents of the file with HAVE_isl, but they all include a ton 
of GCC includes outside the guard.  I moved them inside the guard and 
ran include reduction on them all to remove the unneeded headers.
- graphite.c was similar, except it has a small hunk of code which is 
compiled when HAVE_isl is false. I manually adjusted those includes to 
be minimal, and ran include reduction on the rest.

I bootstrapped with HAVE_isl defined and also with it not defined on 
x86_64-unknown-linux-gnu.  I ran it with no regressions with HAVE_isl 
defined.

OK for trunk?

Andrew

Comments

Jeff Law July 11, 2015, 5:49 a.m. UTC | #1
On 07/10/2015 02:47 PM, Andrew MacLeod wrote:
> I noticed a few annoying bits around the graphite files that I decided
> to cleanup.
>
> - omega.h shouldn't include "config.h".  including params.h is fine
> since it is needed, but it should be within the #ifndef GCC_OMEGA_H guard.
> - sese.h is required for compilation of graphite-poly.h, and basically
> isn't used anywhere else (except sese.c) , so simply include it in
> graphite-poly.h.
> - I adjusted the rest of the graphite files . All but graphite.c guard
> the enter contents of the file with HAVE_isl, but they all include a ton
> of GCC includes outside the guard.  I moved them inside the guard and
> ran include reduction on them all to remove the unneeded headers.
> - graphite.c was similar, except it has a small hunk of code which is
> compiled when HAVE_isl is false. I manually adjusted those includes to
> be minimal, and ran include reduction on the rest.
>
> I bootstrapped with HAVE_isl defined and also with it not defined on
> x86_64-unknown-linux-gnu.  I ran it with no regressions with HAVE_isl
> defined.
>
> OK for trunk?
OK.
jeff
diff mbox

Patch


	* omega.h: Don't include config.h, don't include params.h again if
	omega.h has already been included.
	* graphite-poly.h: Include sese.h.
	* graphite.c: Don't include sese.h, remove needless includes and 
	minimize includes outside #ifdef HAVE_isl block.
	* graphite-blocking.c: Don't include sese.h, remove needless includes,
	and wrap entire file in #ifdef HAVE_isl
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-isl-ast-to-gimple.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.

Index: omega.h
===================================================================
*** omega.h	(revision 225674)
--- omega.h	(working copy)
*************** You should have received a copy of the G
*** 24,35 ****
  along with GCC; see the file COPYING3.  If not see
  <http://www.gnu.org/licenses/>.  */
  
- #include "config.h"
- #include "params.h"
  
  #ifndef GCC_OMEGA_H
  #define GCC_OMEGA_H
  
  #define OMEGA_MAX_VARS PARAM_VALUE (PARAM_OMEGA_MAX_VARS)
  #define OMEGA_MAX_GEQS PARAM_VALUE (PARAM_OMEGA_MAX_GEQS)
  #define OMEGA_MAX_EQS PARAM_VALUE (PARAM_OMEGA_MAX_EQS)
--- 24,35 ----
  along with GCC; see the file COPYING3.  If not see
  <http://www.gnu.org/licenses/>.  */
  
  
  #ifndef GCC_OMEGA_H
  #define GCC_OMEGA_H
  
+ #include "params.h"
+ 
  #define OMEGA_MAX_VARS PARAM_VALUE (PARAM_OMEGA_MAX_VARS)
  #define OMEGA_MAX_GEQS PARAM_VALUE (PARAM_OMEGA_MAX_GEQS)
  #define OMEGA_MAX_EQS PARAM_VALUE (PARAM_OMEGA_MAX_EQS)
Index: graphite-poly.h
===================================================================
*** graphite-poly.h	(revision 225674)
--- graphite-poly.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 22,27 ****
--- 22,29 ----
  #ifndef GCC_GRAPHITE_POLY_H
  #define GCC_GRAPHITE_POLY_H
  
+ #include "sese.h"
+ 
  typedef struct poly_dr *poly_dr_p;
  
  typedef struct poly_bb *poly_bb_p;
Index: graphite.c
===================================================================
*** graphite.c	(revision 225674)
--- graphite.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 46,78 ****
  
  #include "system.h"
  #include "coretypes.h"
- #include "diagnostic-core.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-cfg.h"
  #include "tree-ssa-loop.h"
- #include "tree-dump.h"
- #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
! #include "sese.h"
  #include "dbgcnt.h"
  #include "tree-parloops.h"
- #include "tree-pass.h"
  #include "tree-cfgcleanup.h"
- 
- #ifdef HAVE_isl
- 
- #include "graphite-poly.h"
  #include "graphite-scop-detection.h"
  #include "graphite-isl-ast-to-gimple.h"
  #include "graphite-sese-to-poly.h"
--- 46,70 ----
  
  #include "system.h"
  #include "coretypes.h"
  #include "backend.h"
+ #include "diagnostic-core.h"
+ #include "cfgloop.h"
+ #include "tree-pass.h"
+ 
+ #ifdef HAVE_isl
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
  #include "fold-const.h"
  #include "gimple-iterator.h"
  #include "tree-cfg.h"
  #include "tree-ssa-loop.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
! #include "graphite-poly.h"
  #include "dbgcnt.h"
  #include "tree-parloops.h"
  #include "tree-cfgcleanup.h"
  #include "graphite-scop-detection.h"
  #include "graphite-isl-ast-to-gimple.h"
  #include "graphite-sese-to-poly.h"
Index: graphite-blocking.c
===================================================================
*** graphite-blocking.c	(revision 225674)
--- graphite-blocking.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 31,62 ****
  #include <isl/map.h>
  #include <isl/union_map.h>
  #include <isl/constraint.h>
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "dominance.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "dumpfile.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
- #include "sese.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  
- 
  /* Strip mines with a factor STRIDE the scattering (time) dimension
     around PBB at depth TIME_DEPTH.
  
--- 31,51 ----
Index: graphite-dependences.c
===================================================================
*** graphite-dependences.c	(revision 225674)
--- graphite-dependences.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 30,60 ****
  #include <isl/union_map.h>
  #include <isl/flow.h>
  #include <isl/constraint.h>
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
- #include "tree-scalar-evolution.h"
- #include "sese.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  
  isl_union_map *
  scop_get_dependences (scop_p scop)
  {
--- 30,51 ----
  #include <isl/union_map.h>
  #include <isl/flow.h>
  #include <isl/constraint.h>
  
  #include "system.h"
  #include "coretypes.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
  #include "fold-const.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
  #include "graphite-poly.h"
  
+ 
  isl_union_map *
  scop_get_dependences (scop_p scop)
  {
*************** graphite_legal_transform (scop_p scop)
*** 632,635 ****
    return res;
  }
  
! #endif
--- 623,626 ----
    return res;
  }
  
! #endif /* HAVE_isl */
Index: graphite-interchange.c
===================================================================
*** graphite-interchange.c	(revision 225674)
--- graphite-interchange.c	(working copy)
*************** extern "C" {
*** 42,72 ****
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "dumpfile.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
- #include "tree-scalar-evolution.h"
- #include "sese.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  
  /* XXX isl rewrite following comment */
  /* Builds a linear expression, of dimension DIM, representing PDR's
     memory access:
--- 42,63 ----
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
  
  #include "system.h"
  #include "coretypes.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
  #include "fold-const.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "dumpfile.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
  #include "graphite-poly.h"
  
+ 
  /* XXX isl rewrite following comment */
  /* Builds a linear expression, of dimension DIM, representing PDR's
     memory access:
*************** scop_do_interchange (scop_p scop)
*** 657,661 ****
  }
  
  
! #endif
  
--- 648,652 ----
  }
  
  
! #endif /* HAVE_isl */
  
Index: graphite-isl-ast-to-gimple.c
===================================================================
*** graphite-isl-ast-to-gimple.c	(revision 225674)
--- graphite-isl-ast-to-gimple.c	(working copy)
*************** extern "C" {
*** 37,69 ****
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
! #include "sese.h"
  #include "tree-ssa-loop-manip.h"
  #include "tree-scalar-evolution.h"
  #include "gimple-ssa.h"
  #include "tree-into-ssa.h"
  #include <map>
- 
- #ifdef HAVE_isl
- #include "graphite-poly.h"
  #include "graphite-isl-ast-to-gimple.h"
  
  /* This flag is set when an error occurred during the translation of
--- 37,61 ----
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
  
  #include "system.h"
  #include "coretypes.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
  #include "fold-const.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
! #include "graphite-poly.h"
  #include "tree-ssa-loop-manip.h"
  #include "tree-scalar-evolution.h"
  #include "gimple-ssa.h"
  #include "tree-into-ssa.h"
  #include <map>
  #include "graphite-isl-ast-to-gimple.h"
  
  /* This flag is set when an error occurred during the translation of
*************** graphite_regenerate_ast_isl (scop_p scop
*** 1094,1097 ****
  
    return !graphite_regenerate_error;
  }
! #endif
--- 1086,1089 ----
  
    return !graphite_regenerate_error;
  }
! #endif  /* HAVE_isl */
Index: graphite-optimize-isl.c
===================================================================
*** graphite-optimize-isl.c	(revision 225674)
--- graphite-optimize-isl.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 31,59 ****
  #include <isl/band.h>
  #include <isl/aff.h>
  #include <isl/options.h>
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
- #include "dumpfile.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
- #include "tree-scalar-evolution.h"
- #include "sese.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  
  static isl_union_set *
--- 31,48 ----
*************** optimize_isl (scop_p scop)
*** 623,626 ****
    return true;
  }
  
! #endif
--- 612,615 ----
    return true;
  }
  
! #endif  /* HAVE_isl */
Index: graphite-poly.c
===================================================================
*** graphite-poly.c	(revision 225674)
--- graphite-poly.c	(working copy)
*************** extern "C" {
*** 41,71 ****
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "diagnostic-core.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
- #include "dumpfile.h"
  #include "gimple-pretty-print.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
- #include "tree-scalar-evolution.h"
- #include "sese.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  
  #define OPENSCOP_MAX_STRING 256
--- 41,60 ----
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
  
  #include "system.h"
  #include "coretypes.h"
  #include "backend.h"
+ #include "diagnostic-core.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
  #include "fold-const.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop.h"
  #include "gimple-pretty-print.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
  #include "graphite-poly.h"
  
  #define OPENSCOP_MAX_STRING 256
*************** reverse_loop_for_pbbs (scop_p scop, vec<
*** 1206,1210 ****
  }
  
  
! #endif
  
--- 1195,1199 ----
  }
  
  
! #endif  /* HAVE_isl */
  
Index: graphite-scop-detection.c
===================================================================
*** graphite-scop-detection.c	(revision 225674)
--- graphite-scop-detection.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 28,47 ****
  #include <isl/set.h>
  #include <isl/map.h>
  #include <isl/union_map.h>
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "hard-reg-set.h"
  #include "ssa.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "tree-ssa-loop-manip.h"
  #include "tree-ssa-loop-niter.h"
--- 28,42 ----
*************** along with GCC; see the file COPYING3.
*** 49,63 ****
  #include "tree-into-ssa.h"
  #include "tree-ssa.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
  #include "tree-pass.h"
- #include "sese.h"
- #include "tree-ssa-propagate.h"
- 
- #ifdef HAVE_isl
  #include "graphite-poly.h"
  #include "graphite-scop-detection.h"
  
  /* Forward declarations.  */
--- 44,54 ----
  #include "tree-into-ssa.h"
  #include "tree-ssa.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
  #include "tree-pass.h"
  #include "graphite-poly.h"
+ #include "tree-ssa-propagate.h"
  #include "graphite-scop-detection.h"
  
  /* Forward declarations.  */
*************** dot_scop (scop_p scop)
*** 1637,1640 ****
  #endif
  }
  
! #endif
--- 1628,1631 ----
  #endif
  }
  
! #endif  /* HAVE_isl */
Index: graphite-sese-to-poly.c
===================================================================
*** graphite-sese-to-poly.c	(revision 225674)
--- graphite-sese-to-poly.c	(working copy)
*************** extern "C" {
*** 39,58 ****
  #if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
  }
  #endif
- #endif
  
  #include "system.h"
  #include "coretypes.h"
- #include "alias.h"
  #include "backend.h"
  #include "cfghooks.h"
  #include "tree.h"
  #include "gimple.h"
- #include "rtl.h"
  #include "ssa.h"
- #include "options.h"
  #include "fold-const.h"
- #include "internal-fn.h"
  #include "gimple-iterator.h"
  #include "gimplify.h"
  #include "gimplify-me.h"
--- 39,53 ----
*************** extern "C" {
*** 63,87 ****
  #include "tree-into-ssa.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
- #include "tree-chrec.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
  #include "domwalk.h"
- #include "sese.h"
- #include "tree-ssa-propagate.h"
- 
- #ifdef HAVE_isl
- #include "flags.h"
- #include "insn-config.h"
- #include "expmed.h"
- #include "dojump.h"
- #include "explow.h"
- #include "calls.h"
- #include "emit-rtl.h"
- #include "varasm.h"
- #include "stmt.h"
- #include "expr.h"
  #include "graphite-poly.h"
  #include "graphite-sese-to-poly.h"
  
  
--- 58,68 ----
  #include "tree-into-ssa.h"
  #include "tree-pass.h"
  #include "cfgloop.h"
  #include "tree-data-ref.h"
  #include "tree-scalar-evolution.h"
  #include "domwalk.h"
  #include "graphite-poly.h"
+ #include "tree-ssa-propagate.h"
  #include "graphite-sese-to-poly.h"
  
  
*************** build_poly_scop (scop_p scop)
*** 3187,3190 ****
       representation.  */
    POLY_SCOP_P (scop) = true;
  }
! #endif
--- 3168,3171 ----
       representation.  */
    POLY_SCOP_P (scop) = true;
  }
! #endif  /* HAVE_isl */