Re: [PATCH GCC 2/9]Add interface reseting original copy tables in cfg.c
On Wed, Sep 7, 2016 at 1:20 PM, Jeff Lawwrote: > On 09/06/2016 12:50 PM, Bin Cheng wrote: >> >> Hi, >> This simple patch adds interface reseting original copy table in cfg.c. >> This will be used in rewriting vect_do_peeling_* functions in vectorizer so >> that we don't need to release/allocate tables between prolog and epilog >> peeling. >> >> Thanks, >> bin >> >> 2016-09-01 Bin Cheng >> >> * cfg.c (reset_original_copy_tables): New func. >> * cfg.h (reset_original_copy_tables): New decl. >> > Needs a function comment for reset_original_copy_tables. Should be fine > with that change. Hi, Comment added as suggested. Attached patch committed. Thanks, bin > > Jeff diff --git a/gcc/cfg.c b/gcc/cfg.c index cab66c6..ee2e42c 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -1066,6 +1066,18 @@ initialize_original_copy_tables (void) loop_copy = new hash_table (10); } +/* Reset the data structures to maintain mapping between blocks and + its copies. */ + +void +reset_original_copy_tables (void) +{ + gcc_assert (original_copy_bb_pool); + bb_original->empty (); + bb_copy->empty (); + loop_copy->empty (); +} + /* Free the data structures to maintain mapping between blocks and its copies. */ void diff --git a/gcc/cfg.h b/gcc/cfg.h index 6c8ba7e..ad935e3 100644 --- a/gcc/cfg.h +++ b/gcc/cfg.h @@ -108,6 +108,7 @@ extern void scale_bbs_frequencies_int (basic_block *, int, int, int); extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type, gcov_type); extern void initialize_original_copy_tables (void); +extern void reset_original_copy_tables (void); extern void free_original_copy_tables (void); extern void set_bb_original (basic_block, basic_block); extern basic_block get_bb_original (basic_block);
Re: [PATCH GCC 2/9]Add interface reseting original copy tables in cfg.c
On 09/06/2016 12:50 PM, Bin Cheng wrote: Hi, This simple patch adds interface reseting original copy table in cfg.c. This will be used in rewriting vect_do_peeling_* functions in vectorizer so that we don't need to release/allocate tables between prolog and epilog peeling. Thanks, bin 2016-09-01 Bin Cheng* cfg.c (reset_original_copy_tables): New func. * cfg.h (reset_original_copy_tables): New decl. Needs a function comment for reset_original_copy_tables. Should be fine with that change. Jeff
[PATCH GCC 2/9]Add interface reseting original copy tables in cfg.c
Hi, This simple patch adds interface reseting original copy table in cfg.c. This will be used in rewriting vect_do_peeling_* functions in vectorizer so that we don't need to release/allocate tables between prolog and epilog peeling. Thanks, bin 2016-09-01 Bin Cheng* cfg.c (reset_original_copy_tables): New func. * cfg.h (reset_original_copy_tables): New decl.diff --git a/gcc/cfg.c b/gcc/cfg.c index cab66c6..8e4a044 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -1066,6 +1066,15 @@ initialize_original_copy_tables (void) loop_copy = new hash_table (10); } +void +reset_original_copy_tables (void) +{ + gcc_assert (original_copy_bb_pool); + bb_original->empty (); + bb_copy->empty (); + loop_copy->empty (); +} + /* Free the data structures to maintain mapping between blocks and its copies. */ void diff --git a/gcc/cfg.h b/gcc/cfg.h index 6c8ba7e..ad935e3 100644 --- a/gcc/cfg.h +++ b/gcc/cfg.h @@ -108,6 +108,7 @@ extern void scale_bbs_frequencies_int (basic_block *, int, int, int); extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type, gcov_type); extern void initialize_original_copy_tables (void); +extern void reset_original_copy_tables (void); extern void free_original_copy_tables (void); extern void set_bb_original (basic_block, basic_block); extern basic_block get_bb_original (basic_block);