This removes the dubious dependence computation in if-conversion
just for the sake of testing if that might fail (given the vectorizer
itself doesn't fail that easily).  It's a quadratic operation after all
which we should avoid at all cost.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

Richard.

2015-12-09  Richard Biener  <rguent...@suse.de>

        * tree-if-conv.c (if_convertible_loop_p_1): Do not compute
        dependences.
        (if_convertible_loop_p): Adjust.

Index: gcc/tree-if-conv.c
===================================================================
*** gcc/tree-if-conv.c  (revision 231453)
--- gcc/tree-if-conv.c  (working copy)
*************** predicate_bbs (loop_p loop)
*** 1172,1189 ****
  
  static bool
  if_convertible_loop_p_1 (struct loop *loop,
-                        vec<loop_p> *loop_nest,
                         vec<data_reference_p> *refs,
!                        vec<ddr_p> *ddrs, bool *any_mask_load_store)
  {
-   bool res;
    unsigned int i;
    basic_block exit_bb = NULL;
  
!   /* Don't if-convert the loop when the data dependences cannot be
!      computed: the loop won't be vectorized in that case.  */
!   res = compute_data_dependences_for_loop (loop, true, loop_nest, refs, ddrs);
!   if (!res)
      return false;
  
    calculate_dominance_info (CDI_DOMINATORS);
--- 1172,1184 ----
  
  static bool
  if_convertible_loop_p_1 (struct loop *loop,
                         vec<data_reference_p> *refs,
!                        bool *any_mask_load_store)
  {
    unsigned int i;
    basic_block exit_bb = NULL;
  
!   if (find_data_references_in_loop (loop, refs) == chrec_dont_know)
      return false;
  
    calculate_dominance_info (CDI_DOMINATORS);
*************** if_convertible_loop_p (struct loop *loop
*** 1300,1306 ****
    edge_iterator ei;
    bool res = false;
    vec<data_reference_p> refs;
-   vec<ddr_p> ddrs;
  
    /* Handle only innermost loop.  */
    if (!loop || loop->inner)
--- 1295,1300 ----
*************** if_convertible_loop_p (struct loop *loop
*** 1333,1342 ****
        return false;
  
    refs.create (5);
!   ddrs.create (25);
!   auto_vec<loop_p, 3> loop_nest;
!   res = if_convertible_loop_p_1 (loop, &loop_nest, &refs, &ddrs,
!                                any_mask_load_store);
  
    data_reference_p dr;
    unsigned int i;
--- 1327,1333 ----
        return false;
  
    refs.create (5);
!   res = if_convertible_loop_p_1 (loop, &refs, any_mask_load_store);
  
    data_reference_p dr;
    unsigned int i;
*************** if_convertible_loop_p (struct loop *loop
*** 1344,1350 ****
      free (dr->aux);
  
    free_data_refs (refs);
-   free_dependence_relations (ddrs);
  
    delete ref_DR_map;
    ref_DR_map = NULL;
--- 1335,1340 ----

Reply via email to