[lno][patch]Enable versioning for alignment with unknown loop bounds

Keith Besaw kbesaw@us.ibm.com
Wed Oct 13 23:03:00 GMT 2004


When loop versioning to vectorized potentially aligned data was first 
implemented
there was an interaction problem with the loop peel done to vectorize 
unknown loop
bounds.  For this reason versioning was disabled if peeling was being 
done.
The interaction problem no longer exists so this patch removes the 
restriction.

testing on ppc
bootstrapped, no new failures with make check, no new failures on SPEC
one more loop vectorized in vect-50.c in gcc.dg/vect tests

Keith

Changelog:

        * tree-vectorizer.c (vect_enhance_data_refs_alignment): remove 
test
        that the loop upper bound is known at compile time.
        (vect_transform_loop): remove ifdef check that versioning is only 
being
        done when the loop upper bound is known at compile time.

testsuite/Changelog:

        * gcc.dg/vect/vect-50.c: Remove xfail *-*-*, now vectorized.




Index: tree-vectorizer.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 1.1.2.71
diff -c -3 -p -r1.1.2.71 tree-vectorizer.c
*** tree-vectorizer.c   3 Oct 2004 15:58:45 -0000       1.1.2.71
--- tree-vectorizer.c   13 Oct 2004 06:14:33 -0000
*************** vect_transform_loop (loop_vec_info loop_
*** 3172,3182 ****
        basic_block condition_bb;
        tree cond_expr;
 
- #ifdef ENABLE_CHECKING
-       if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)) /* FORNOW */
-         abort();
- #endif
- 
        /* vect_create_cond_for_align_checks will fill in the left opnd 
later. */
        cond_expr = build2 (EQ_EXPR, boolean_type_node,
                                 NULL_TREE, integer_zero_node);
--- 3172,3177 ----
*************** vect_enhance_data_refs_alignment (loop_v
*** 4373,4383 ****
       One possible solution is to do renaming immediately after a loop is
       vectorized.  Another possible solution is a form of 
tree_ssa_loop_version
       that updates vars_to_rename so that renaming can be delayed.  */
!   /* FORNOW: the loop versioning that is used to attempt vectorization 
on
!      potentially unaligned data refs isn't working with the loop peel
!      done for unknown loop bounds.  */
!   if ((bitmap_first_set_bit (vars_to_rename) >= 0)
!       ||(!LOOP_VINFO_NITERS_KNOWN_P (loop_info)))
      return;
 
    loop_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_info);
--- 4368,4374 ----
       One possible solution is to do renaming immediately after a loop is
       vectorized.  Another possible solution is a form of 
tree_ssa_loop_version
       that updates vars_to_rename so that renaming can be delayed.  */
!   if (bitmap_first_set_bit (vars_to_rename) >= 0)
      return;
 
    loop_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_info);






Index: vect-50.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/gcc.dg/vect/vect-50.c,v
retrieving revision 1.1.8.3
diff -c -3 -p -r1.1.8.3 vect-50.c
*** vect-50.c   29 Sep 2004 20:40:50 -0000      1.1.8.3
--- vect-50.c   13 Oct 2004 06:32:17 -0000
*************** int main (void)
*** 52,55 ****
    return 0;
  }
 
! /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { 
xfail *-*-* } } } */
--- 52,55 ----
    return 0;
  }
 
! /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } 
*/



More information about the Gcc-patches mailing list