Commit c420be8b by Roman Zhuykov Committed by Roman Zhuykov

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
parent 728c2e5e
2019-12-13 Roman Zhuykov <zhroma@ispras.ru> 2019-12-13 Roman Zhuykov <zhroma@ispras.ru>
* 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 <zhroma@ispras.ru>
* ddg.c (create_ddg): Init max_dist array for each node. * ddg.c (create_ddg): Init max_dist array for each node.
(free_ddg): Free max_dist array. (free_ddg): Free max_dist array.
(create_ddg_edge): Use bool field instead of aux union. (create_ddg_edge): Use bool field instead of aux union.
...@@ -1331,9 +1331,6 @@ setup_sched_infos (void) ...@@ -1331,9 +1331,6 @@ setup_sched_infos (void)
version may be entered. Just a guess. */ version may be entered. Just a guess. */
#define PROB_SMS_ENOUGH_ITERATIONS 80 #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 /* Main entry point, perform SMS scheduling on the loops of the function
that consist of single basic blocks. */ that consist of single basic blocks. */
static void static void
...@@ -1597,7 +1594,7 @@ sms_schedule (void) ...@@ -1597,7 +1594,7 @@ sms_schedule (void)
rec_mii = sms_order_nodes (g, mii, node_order, &max_asap); rec_mii = sms_order_nodes (g, mii, node_order, &max_asap);
mii = MAX (res_MII (g), rec_mii); mii = MAX (res_MII (g), rec_mii);
mii = MAX (mii, 1); mii = MAX (mii, 1);
maxii = MAX (max_asap, MAXII_FACTOR * mii); maxii = MAX (max_asap, param_sms_max_ii_factor * mii);
if (dump_file) if (dump_file)
fprintf (dump_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n", fprintf (dump_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n",
...@@ -1636,7 +1633,7 @@ sms_schedule (void) ...@@ -1636,7 +1633,7 @@ sms_schedule (void)
gcc_assert (stage_count >= 1); 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 1 means that there is no interleaving between iterations thus
we let the scheduling passes do the job in this case. */ we let the scheduling passes do the job in this case. */
if (stage_count < param_sms_min_sc if (stage_count < param_sms_min_sc
...@@ -1828,11 +1825,6 @@ sms_schedule (void) ...@@ -1828,11 +1825,6 @@ sms_schedule (void)
The window would then start and end on the same row, but with The window would then start and end on the same row, but with
different "must precede" and "must follow" requirements. */ 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 /* A threshold for the number of repeated unsuccessful attempts to insert
an empty row, before we flush the partial schedule and start over. */ an empty row, before we flush the partial schedule and start over. */
#define MAX_SPLIT_NUM 10 #define MAX_SPLIT_NUM 10
...@@ -2136,7 +2128,12 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order) ...@@ -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 must_follow (num_nodes);
auto_sbitmap tobe_scheduled (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_ones (tobe_scheduled);
bitmap_clear (sched_nodes); bitmap_clear (sched_nodes);
......
...@@ -817,7 +817,7 @@ Common Joined UInteger Var(param_slp_max_insns_in_bb) Init(1000) Param ...@@ -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. Maximum number of instructions in basic block to be considered for SLP vectorization.
-param=sms-dfa-history= -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. The number of cycles the swing modulo scheduler considers when checking conflicts using DFA.
-param=sms-loop-average-count-threshold= -param=sms-loop-average-count-threshold=
...@@ -825,11 +825,11 @@ Common Joined UInteger Var(param_sms_loop_average_count_threshold) Param ...@@ -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. A threshold on the average loop count considered by the swing modulo scheduler.
-param=sms-max-ii-factor= -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. A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop.
-param=sms-min-sc= -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. The minimum value of stage count that swing modulo scheduler will generate.
-param=sra-max-scalarization-size-Osize= -param=sra-max-scalarization-size-Osize=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment