[PATCH][vect] Keep track of DR_OFFSET advance in dr_vec_info rather than data_reference

Andre Vieira (lists) andre.simoesdiasvieira@arm.com
Tue Dec 10 13:36:00 GMT 2019


Hi,

This patch aims at refactoring the vectorizer code to no longer need to 
reset DR_OFFSET for epilogue vectorization and instead keep track of 
DR_OFFSET changes per dr_vec_info and just update it as needed.  I added 
a member of type 'tree' called 'offset' to dr_vec_info, which keeps 
track of the changes to the data_reference's offset per dr_vec_info and 
thus per instance of loop vectorization.  To get the current loop's 
DR_OFFSET I introduced a function 'get_dr_vinfo_offset' which will add 
the dr_vec_info's offset to either the data_reference's innermost offset 
or the offset of the 'innermost_loop_behavior' returned by 
'vect_dr_behavior' depending on whether 'get_dr_vinfo_offset's second 
parameter 'check_outer' is true.  This is to mimic the behavior of using 
the outer loop relative 'innermost_loop_behavior' in 
'vect_create_addr_base_for_vector_ref'.

I regression tested vect.exp on aarch64 and x86_64. I also regression 
tested libgomp on aarch64 and x86_64, no changes, but there were quite a 
few test failures with the commit I based this patch on...

Is this OK for trunk or shall I wait until libgomp stabilizes?

2019-12-10  Andre Vieira  <andre.simoesdiasvieira@arm.com>

         * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Use
         get_dr_vinfo_offset
         * tree-vect-loop.c (update_epilogue_loop_vinfo):  Remove 
orig_drs_init
         parameter and its use to reset DR_OFFSET's.
         (vect_transform_loop): Remove orig_drs_init argument.
         * tree-vect-loop-manip.c (vect_update_init_of_dr): Update the 
offset
         member of dr_vec_info rather than the offset of the associated
         data_reference's innermost_loop_behavior.
         (vect_update_init_of_dr): Pass dr_vec_info instead of 
data_reference.
         (vect_do_peeling): Remove orig_drs_init parameter and its
         construction.
         * tree-vect-stmts.c (check_scan_store): Replace use of DR_OFFSET
         with get_dr_vinfo_offset.
         (vectorizable_store): Likewise.
         (vectorizable_load): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dr_offset_1.patch
Type: text/x-patch
Size: 10688 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191210/6825b488/attachment.bin>


More information about the Gcc-patches mailing list