Fix peeling for alignment with negative step
The following fixes a regression causing us to no longer peel
negative step loops for alignment. With dr_misalignment now
applying the bias for negative step we have to do the reverse
when adjusting the misalignment for peeled DRs.
2021-09-29 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_dr_misalign_for_aligned_access):
New helper.
(vect_update_misalignment_for_peel): Use it to update
misaligned to the value necessary for an aligned access.
(vect_get_peeling_costs_all_drs): Likewise.
(vect_enhance_data_refs_alignment): Likewise.
* gcc.target/i386/vect-alignment-peeling-1.c: New testcase.
* gcc.target/i386/vect-alignment-peeling-2.c: Likewise.