This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lno] [PATCH] Fix dependence graph


After dependence graph is created, vectorizer could not vectorize loops.
This patch fixes dependence graph, so that it does not use
loop_optimize_init() to check if loops exist. Now it checks new
bool that is set by scev depend pass.

--
Devang

2004-03-01 Devang Patel <dpatel@apple.com>

        * tree-data-ref.h (dd_info_available): New extern decl.
        * tree-dg.c (gate_ddg): Check dd_info_available.
        * tree-scalar-evolution.c (dd_info_available): New.
        (scev_depend): Set dd_info_available.
        (scev_done): Reset dd_info_available.
        (pass_scev_anal): Do not provide PROP_scev.
        (pass_scev_depend): Provide PROP_scev.

Index: tree-data-ref.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-data-ref.h,v
retrieving revision 1.1.2.6
diff -Idpatel.pbxuser -c -3 -p -r1.1.2.6 tree-data-ref.h
*** tree-data-ref.h     21 Feb 2004 01:09:47 -0000      1.1.2.6
--- tree-data-ref.h     2 Mar 2004 05:43:38 -0000
*************** array_base_name_differ_p (struct data_re
*** 185,189 ****
--- 185,191 ----
    return true;
  }

+ /* Flag to indicate availability of dependency info.  */
+ extern bool dd_info_available;

  #endif  /* GCC_TREE_DATA_REF_H  */
Index: tree-dg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dg.c,v
retrieving revision 1.1.2.4
diff -Idpatel.pbxuser -c -3 -p -r1.1.2.4 tree-dg.c
*** tree-dg.c   1 Mar 2004 23:47:40 -0000       1.1.2.4
--- tree-dg.c   2 Mar 2004 05:43:38 -0000
*************** ddg_distance_between_stmts (tree stmt1,
*** 519,528 ****
  static bool
  gate_ddg (void)
  {
!   struct loops *current_loops;
!
!   current_loops = loop_optimizer_init (NULL);
!   return current_loops && flag_ddg && flag_scalar_evolutions != 0;
  }

  struct tree_opt_pass pass_ddg =
--- 519,525 ----
  static bool
  gate_ddg (void)
  {
!   return dd_info_available && flag_ddg && flag_scalar_evolutions != 0;
  }

  struct tree_opt_pass pass_ddg =
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.c,v
retrieving revision 1.1.2.14
diff -Idpatel.pbxuser -c -3 -p -r1.1.2.14 tree-scalar-evolution.c
*** tree-scalar-evolution.c     16 Feb 2004 21:59:28 -0000      1.1.2.14
--- tree-scalar-evolution.c     2 Mar 2004 05:43:39 -0000
*************** tree chrec_bot;
*** 239,244 ****
--- 239,247 ----
     - the function's parameters.  */
  tree chrec_symbolic_parameter;

+ /* Flag to indicate availability of dependency info.  */
+ bool dd_info_available;
+
  static struct loops *scev_loops;
  static varray_type scev_info;

*************** static void
*** 4271,4276 ****
--- 4274,4280 ----
  scev_depend (void)
  {
    analyze_all_data_dependences ();
+   dd_info_available = true;
  }

  static void
*************** scev_done (void)
*** 4291,4296 ****
--- 4295,4302 ----
        loop_optimizer_finalize (current_loops, NULL);
        current_loops = NULL;
      }
+
+   dd_info_available = false;
  }

static bool
*************** struct tree_opt_pass pass_scev_anal =
*** 4347,4353 ****
0, /* static_pass_number */
TV_SCALAR_EVOLUTIONS, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
! PROP_scev, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
--- 4353,4359 ----
0, /* static_pass_number */
TV_SCALAR_EVOLUTIONS, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
! 0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
*************** struct tree_opt_pass pass_scev_depend =
*** 4369,4375 ****
0, /* static_pass_number */
TV_ALL_DATA_DEPS, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
! 0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
--- 4375,4381 ----
0, /* static_pass_number */
TV_ALL_DATA_DEPS, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
! PROP_scev, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]