Commit 20160347 by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

gcse.c (struct expr:max_distance): New field.

	* gcse.c (struct expr:max_distance): New field.
	(doing_code_hoisting_p): New static variable.
	(want_to_gcse_p): Change signature.  Allow constrained hoisting of
	simple expressions, don't change behavior for PRE.  Set max_distance.
	(insert_expr_in_table): Set new max_distance field.
	(hash_scan_set): Update.
	(hoist_expr_reaches_here_p): Stop search after max_distance
	instructions.
	(find_occr_in_bb): New static function.  Use it in ...
	(hoist_code): Calculate sizes of basic block before any changes are
	done.  Pass max_distance to hoist_expr_reaches_here_p.
	(one_code_hoisting_pass): Set doing_code_hoisting_p.

	* params.def (PARAM_GCSE_COST_DISTANCE_RATIO,)
	(PARAM_GCSE_UNRESTRICTED_COST): New parameters.
	* params.h (GCSE_COST_DISTANCE_RATIO, GCSE_UNRESTRICTED_COST): New
	macros.
	* doc/invoke.texi (gcse-cost-distance-ratio, gcse-unrestricted-cost):
	Document.

From-SVN: r162589
parent 9b774782
2010-07-27 Maxim Kuvyrkov <maxim@codesourcery.com>
* gcse.c (struct expr:max_distance): New field.
(doing_code_hoisting_p): New static variable.
(want_to_gcse_p): Change signature. Allow constrained hoisting of
simple expressions, don't change behavior for PRE. Set max_distance.
(insert_expr_in_table): Set new max_distance field.
(hash_scan_set): Update.
(hoist_expr_reaches_here_p): Stop search after max_distance
instructions.
(find_occr_in_bb): New static function. Use it in ...
(hoist_code): Calculate sizes of basic block before any changes are
done. Pass max_distance to hoist_expr_reaches_here_p.
(one_code_hoisting_pass): Set doing_code_hoisting_p.
* params.def (PARAM_GCSE_COST_DISTANCE_RATIO,)
(PARAM_GCSE_UNRESTRICTED_COST): New parameters.
* params.h (GCSE_COST_DISTANCE_RATIO, GCSE_UNRESTRICTED_COST): New
macros.
* doc/invoke.texi (gcse-cost-distance-ratio, gcse-unrestricted-cost):
Document.
2010-07-27 Jeff Law <law@redhat.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
......
......@@ -8243,6 +8243,23 @@ when @option{-ftree-vectorize} is used. The number of iterations after
vectorization needs to be greater than the value specified by this option
to allow vectorization. The default value is 0.
@item gcse-cost-distance-ratio
Scaling factor in calculation of maximum distance an expression
can be moved by GCSE optimizations. This is currently supported only in
code hoisting pass. The bigger the ratio, the more agressive code hoisting
will be with simple expressions, i.e., the expressions which have cost
less than @option{gcse-unrestricted-cost}. Specifying 0 will disable
hoisting of simple expressions. The default value is 10.
@item gcse-unrestricted-cost
Cost, roughly measured as the cost of a single typical machine
instruction, at which GCSE optimizations will not constrain
the distance an expression can travel. This is currently
supported only in code hoisting pass. The lesser the cost,
the more aggressive code hoisting will be. Specifying 0 will
allow all expressions to travel unrestricted distances.
The default value is 3.
@item max-unrolled-insns
The maximum number of instructions that a loop should have if that loop
is unrolled, and if the loop is unrolled, it determines how many times
......
......@@ -225,6 +225,21 @@ DEFPARAM(PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION,
"gcse-after-reload-critical-fraction",
"The threshold ratio of critical edges execution count that permit performing redundancy elimination after reload",
10, 0, 0)
/* GCSE will use GCSE_COST_DISTANCE_RATION as a scaling factor
to calculate maximum distance for which an expression is allowed to move
from its rtx_cost. */
DEFPARAM(PARAM_GCSE_COST_DISTANCE_RATIO,
"gcse-cost-distance-ratio",
"Scaling factor in calculation of maximum distance an expression can be moved by GCSE optimizations",
10, 0, 0)
/* GCSE won't restrict distance for which an expression with rtx_cost greater
than COSTS_N_INSN(GCSE_UNRESTRICTED_COST) is allowed to move. */
DEFPARAM(PARAM_GCSE_UNRESTRICTED_COST,
"gcse-unrestricted-cost",
"Cost at which GCSE optimizations will not constraint the distance an expression can travel",
3, 0, 0)
/* This parameter limits the number of insns in a loop that will be unrolled,
and by how much the loop is unrolled.
......
......@@ -125,6 +125,10 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION)
#define GCSE_AFTER_RELOAD_CRITICAL_FRACTION \
PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION)
#define GCSE_COST_DISTANCE_RATIO \
PARAM_VALUE (PARAM_GCSE_COST_DISTANCE_RATIO)
#define GCSE_UNRESTRICTED_COST \
PARAM_VALUE (PARAM_GCSE_UNRESTRICTED_COST)
#define MAX_UNROLLED_INSNS \
PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)
#define MAX_SMS_LOOP_NUMBER \
......
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