https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115060
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Feng Xue <f...@gcc.gnu.org>: https://gcc.gnu.org/g:a3aeff4ce95bd616a2108dc2363d9cbaba53b170 commit r15-863-ga3aeff4ce95bd616a2108dc2363d9cbaba53b170 Author: Feng Xue <f...@os.amperecomputing.com> Date: Thu May 23 15:25:53 2024 +0800 vect: Use vect representative statement instead of original in patch recog [PR115060] Some utility functions (such as vect_look_through_possible_promotion) that are to find out certain kind of direct or indirect definition SSA for a value, may return the original one of the SSA, not its pattern representative SSA, even pattern is involved. For example, a = (T1) patt_b; patt_b = (T2) c; // b = ... patt_c = not-a-cast; // c = ... Given 'a', the mentioned function will return 'c', instead of 'patt_c'. This subtlety would make some pattern recog code that is unaware of it mis-use the original instead of the new pattern statement, which is inconsistent wth processing logic of the pattern formation pass. This patch corrects the issue by forcing another utility function (vect_get_internal_def) return the pattern statement information to caller by default. 2024-05-23 Feng Xue <f...@os.amperecomputing.com> gcc/ PR tree-optimization/115060 * tree-vect-patterns.cc (vect_get_internal_def): Return statement for vectorization. (vect_widened_op_tree): Call vect_get_internal_def instead of look_def to get statement information. (vect_recog_widen_abd_pattern): No need to call vect_stmt_to_vectorize.