aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.cc
diff options
context:
space:
mode:
authorFeng Xue <fxue@os.amperecomputing.com>2023-12-28 16:55:39 +0800
committerFeng Xue <fxue@os.amperecomputing.com>2024-01-16 11:36:08 +0800
commit57f611604e8bab67af6c0bcfe6ea88c001408412 (patch)
tree67e65882e82ca7d5708587dd759be6412892e225 /gcc/cfgexpand.cc
parent5134d3074ad7a462b4c8e2c0bc904b5ba40b7373 (diff)
downloadgcc-57f611604e8bab67af6c0bcfe6ea88c001408412.zip
gcc-57f611604e8bab67af6c0bcfe6ea88c001408412.tar.gz
gcc-57f611604e8bab67af6c0bcfe6ea88c001408412.tar.bz2
Do not count unused scalar use when marking STMT_VINFO_LIVE_P [PR113091]
When pattern recognition is involved, a statement whose definition is consumed in some pattern, may not be included in the final replacement pattern statements, and would be skipped when building SLP graph. * Original char a_c = *(char *) a; char b_c = *(char *) b; unsigned short a_s = (unsigned short) a_c; int a_i = (int) a_s; int b_i = (int) b_c; int r_i = a_i - b_i; * After pattern replacement a_s = (unsigned short) a_c; a_i = (int) a_s; patt_b_s = (unsigned short) b_c; // b_i = (int) b_c patt_b_i = (int) patt_b_s; // b_i = (int) b_c patt_r_s = widen_minus(a_c, b_c); // r_i = a_i - b_i patt_r_i = (int) patt_r_s; // r_i = a_i - b_i The definitions of a_i(original statement) and b_i(pattern statement) are related to, but actually not part of widen_minus pattern. Vectorizing the pattern does not cause these definition statements to be marked as PURE_SLP. For this case, we need to recursively check whether their uses are all absorbed into vectorized code. But there is an exception that some use may participate in an vectorized operation via an external SLP node containing that use as an element. gcc/ChangeLog: PR tree-optimization/113091 * tree-vect-slp.cc (vect_slp_has_scalar_use): New function. (vect_bb_slp_mark_live_stmts): New parameter scalar_use_map, check scalar use with new function. (vect_bb_slp_mark_live_stmts): New function as entry to existing overriden functions with same name. (vect_slp_analyze_operations): Call new entry function to mark live statements. gcc/testsuite/ChangeLog: * gcc.target/aarch64/bb-slp-pr113091.c: New test.
Diffstat (limited to 'gcc/cfgexpand.cc')
0 files changed, 0 insertions, 0 deletions