https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106365
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:bd9837bc3ca1344c32aef7ba9f8fa1785063132e commit r13-1777-gbd9837bc3ca1344c32aef7ba9f8fa1785063132e Author: Richard Biener <rguent...@suse.de> Date: Wed Jul 20 12:28:26 2022 +0200 Teach VN about masked/len stores The following teaches VN to handle reads from .MASK_STORE and .LEN_STORE. For this push_partial_def is extended first for convenience so we don't have to handle the full def case in the caller (possibly other paths can be simplified then). Also the partial definition stored value can have an offset applied so we don't have to build a fake RHS when we register the pieces of an existing store. PR tree-optimization/106365 * tree-ssa-sccvn.cc (pd_data::rhs_off): New field determining the offset to start encoding of RHS from. (vn_walk_cb_data::vn_walk_cb_data): Initialize it. (vn_walk_cb_data::push_partial_def): Allow the first partial definition to be fully providing the def. Offset RHS before encoding if requested. (vn_reference_lookup_3): Initialize def_rhs everywhere. Add support for .MASK_STORE and .LEN_STORE (partial) definitions. * gcc.target/i386/vec-maskstore-vn.c: New testcase.