Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD
commit5dde64775baad91686a33edc020f74cfaa9078e5
authorRichard Biener <rguenther@suse.de>
Fri, 20 Oct 2023 07:30:45 +0000 (20 09:30 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 20 Oct 2023 09:09:58 +0000 (20 11:09 +0200)
tree2b6a88a2d893cd8f0c0e7042369e404c6b309566
parent5f71e002f8881c8176efa54f83615d2270152e75
Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

I went a little bit too simple with implementing SLP gather support
for emulated and builtin based gathers.  The following fixes the
conflict that appears when running into .MASK_LOAD where we rely
on vect_get_operand_map and the bolted-on STMT_VINFO_GATHER_SCATTER_P
checking wrecks that.  The following properly integrates this with
vect_get_operand_map, adding another special index refering to
the vect_check_gather_scatter analyzed offset.

This unbreaks aarch64 (and hopefully riscv), I'll followup with
more fixes and testsuite coverage for x86 where I think I got
masked gather SLP support wrong.

* tree-vect-slp.cc (off_map, off_op0_map, off_arg2_map,
off_arg3_arg2_map): New.
(vect_get_operand_map): Get flag whether the stmt was
recognized as gather or scatter and use the above
accordingly.
(vect_get_and_check_slp_defs): Adjust.
(vect_build_slp_tree_2): Likewise.
gcc/tree-vect-slp.cc