From c420be8b3c5fd9e9d80dd583e790f0c2a7c4954b Mon Sep 17 00:00:00 2001 From: Roman Zhuykov Date: Fri, 13 Dec 2019 17:17:31 +0000 Subject: [PATCH] modulo-sched: fix parameters usage and their ranges * modulo-sched.c (sms_schedule): Use param_sms_max_ii_factor value instead of macro. Adjust comment. (sms_schedule_by_order): Use parameter value without macro. * params.opt: Add ranges for modulo scheduler parameters, set param_sms_max_ii_factor = 2 by default. From-SVN: r279376 --- gcc/ChangeLog | 8 ++++++++ gcc/modulo-sched.c | 19 ++++++++----------- gcc/params.opt | 6 +++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46795b26cff..56d05cc4986 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-12-13 Roman Zhuykov + + * modulo-sched.c (sms_schedule): Use param_sms_max_ii_factor + value instead of macro. Adjust comment. + (sms_schedule_by_order): Use parameter value without macro. + * params.opt: Add ranges for modulo scheduler parameters, + set param_sms_max_ii_factor = 2 by default. + 2019-12-13 Roman Zhuykov * ddg.c (create_ddg): Init max_dist array for each node. diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 98af5498a99..2dc9af70930 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -1331,9 +1331,6 @@ setup_sched_infos (void) version may be entered. Just a guess. */ #define PROB_SMS_ENOUGH_ITERATIONS 80 -/* Used to calculate the upper bound of ii. */ -#define MAXII_FACTOR 2 - /* Main entry point, perform SMS scheduling on the loops of the function that consist of single basic blocks. */ static void @@ -1597,7 +1594,7 @@ sms_schedule (void) rec_mii = sms_order_nodes (g, mii, node_order, &max_asap); mii = MAX (res_MII (g), rec_mii); mii = MAX (mii, 1); - maxii = MAX (max_asap, MAXII_FACTOR * mii); + maxii = MAX (max_asap, param_sms_max_ii_factor * mii); if (dump_file) fprintf (dump_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n", @@ -1636,7 +1633,7 @@ sms_schedule (void) gcc_assert (stage_count >= 1); } - /* The default value of PARAM_SMS_MIN_SC is 2 as stage count of + /* The default value of param_sms_min_sc is 2 as stage count of 1 means that there is no interleaving between iterations thus we let the scheduling passes do the job in this case. */ if (stage_count < param_sms_min_sc @@ -1828,11 +1825,6 @@ sms_schedule (void) The window would then start and end on the same row, but with different "must precede" and "must follow" requirements. */ -/* A limit on the number of cycles that resource conflicts can span. ??? Should - be provided by DFA, and be dependent on the type of insn scheduled. Currently - set to 0 to save compile time. */ -#define DFA_HISTORY param_sms_dfa_history - /* A threshold for the number of repeated unsuccessful attempts to insert an empty row, before we flush the partial schedule and start over. */ #define MAX_SPLIT_NUM 10 @@ -2136,7 +2128,12 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order) auto_sbitmap must_follow (num_nodes); auto_sbitmap tobe_scheduled (num_nodes); - partial_schedule_ptr ps = create_partial_schedule (ii, g, DFA_HISTORY); + /* Value of param_sms_dfa_history is a limit on the number of cycles that + resource conflicts can span. ??? Should be provided by DFA, and be + dependent on the type of insn scheduled. Set to 0 by default to save + compile time. */ + partial_schedule_ptr ps = create_partial_schedule (ii, g, + param_sms_dfa_history); bitmap_ones (tobe_scheduled); bitmap_clear (sched_nodes); diff --git a/gcc/params.opt b/gcc/params.opt index d88ae0c468b..06d8b0e0400 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -817,7 +817,7 @@ Common Joined UInteger Var(param_slp_max_insns_in_bb) Init(1000) Param Maximum number of instructions in basic block to be considered for SLP vectorization. -param=sms-dfa-history= -Common Joined UInteger Var(param_sms_dfa_history) Param +Common Joined UInteger Var(param_sms_dfa_history) IntegerRange(0, 16) Param The number of cycles the swing modulo scheduler considers when checking conflicts using DFA. -param=sms-loop-average-count-threshold= @@ -825,11 +825,11 @@ Common Joined UInteger Var(param_sms_loop_average_count_threshold) Param A threshold on the average loop count considered by the swing modulo scheduler. -param=sms-max-ii-factor= -Common Joined UInteger Var(param_sms_max_ii_factor) Init(100) Param +Common Joined UInteger Var(param_sms_max_ii_factor) Init(2) IntegerRange(1, 16) Param A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop. -param=sms-min-sc= -Common Joined UInteger Var(param_sms_min_sc) Init(2) IntegerRange(1, 65536) Param +Common Joined UInteger Var(param_sms_min_sc) Init(2) IntegerRange(1, 2) Param The minimum value of stage count that swing modulo scheduler will generate. -param=sra-max-scalarization-size-Osize= -- 2.30.2