From d4f3c3efc669afe6e270344ff73c7471fea67ce7 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 3 Dec 2024 08:52:48 +0100 Subject: Use the number of relevant stmts to limit SLP build The following removes scalar stmt counting from loop vectorization and using that as base to limit both the SLP tree final size and discovery. Instead use the number of relevant stmts for that which is conveniently the number of stmt_vec_infos we create which in turn includes things like pattern stmts. PR tree-optimization/117874 * tree-vectorizer.h (vec_info_shared::n_stmts): Remove. (LOOP_VINFO_N_STMTS): Likewise. * tree-vectorizer.cc (vec_info_shared::vec_info_shared): Adjust. * tree-vect-loop.cc (vect_get_datarefs_in_loop): Do not count stmts. (vect_analyze_loop_2): Adjust. Pass stmt_vec_info.length () to vect_analyze_slp as SLP tree size limit. --- gcc/tree-vectorizer.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 7f69a3f..1059fc5 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -474,9 +474,6 @@ public: void save_datarefs(); void check_datarefs(); - /* The number of scalar stmts. */ - unsigned n_stmts; - /* All data references. Freed by free_data_refs, so not an auto_vec. */ vec datarefs; vec datarefs_copy; @@ -1070,7 +1067,6 @@ public: #define LOOP_VINFO_RGROUP_IV_TYPE(L) (L)->rgroup_iv_type #define LOOP_VINFO_PARTIAL_VECTORS_STYLE(L) (L)->partial_vector_style #define LOOP_VINFO_PTR_MASK(L) (L)->ptr_mask -#define LOOP_VINFO_N_STMTS(L) (L)->shared->n_stmts #define LOOP_VINFO_LOOP_NEST(L) (L)->shared->loop_nest #define LOOP_VINFO_DATAREFS(L) (L)->shared->datarefs #define LOOP_VINFO_DDRS(L) (L)->shared->ddrs -- cgit v1.1