Commit 39aada70 by Yuri Rumyantsev Committed by Kirill Yukhin

i386.c (insn_is_function_arg): Add check on CALL instruction.

        * config/i386/i386.c (insn_is_function_arg) : Add check on CALL
        instruction.
        (ix86_dependencies_evaluation_hook): Insert dependencies in all
        predecessors of call block for non-trivial region avoiding creation
        of loop-carried dependency to avoid cross-block motion of HW registers.

From-SVN: r192842
parent 9037dcc6
2012-10-23 Yuri Rumyantsev <ysrumyan@gmail.com>
* config/i386/i386.c (insn_is_function_arg) : Add check on CALL
instruction.
(ix86_dependencies_evaluation_hook): Insert dependencies in all
predecessors of call block for non-trivial region avoiding creation
of loop-carried dependency to avoid cross-block motion of HW registers.
2012-10-26 Richard Biener <rguenther@suse.de> 2012-10-26 Richard Biener <rguenther@suse.de>
PR middle-end/54824 PR middle-end/54824
...@@ -24454,6 +24454,9 @@ insn_is_function_arg (rtx insn, bool* is_spilled) ...@@ -24454,6 +24454,9 @@ insn_is_function_arg (rtx insn, bool* is_spilled)
if (!NONDEBUG_INSN_P (insn)) if (!NONDEBUG_INSN_P (insn))
return false; return false;
/* Call instructions are not movable, ignore it. */
if (CALL_P (insn))
return false;
insn = PATTERN (insn); insn = PATTERN (insn);
if (GET_CODE (insn) == PARALLEL) if (GET_CODE (insn) == PARALLEL)
insn = XVECEXP (insn, 0, 0); insn = XVECEXP (insn, 0, 0);
...@@ -24586,18 +24589,26 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail) ...@@ -24586,18 +24589,26 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail)
first_arg = add_parameter_dependencies (insn, head); first_arg = add_parameter_dependencies (insn, head);
if (first_arg) if (first_arg)
{ {
/* Check if first argument has dependee out of its home block. */ /* Add dependee for first argument to predecessors if only
sd_iterator_def sd_it1; region contains more than one block. */
dep_t dep1; basic_block bb = BLOCK_FOR_INSN (insn);
FOR_EACH_DEP (first_arg, SD_LIST_BACK, sd_it1, dep1) int rgn = CONTAINING_RGN (bb->index);
int nr_blks = RGN_NR_BLOCKS (rgn);
/* Skip trivial regions and region head blocks that can have
predecessors outside of region. */
if (nr_blks > 1 && BLOCK_TO_BB (bb->index) != 0)
{ {
rtx dee; edge e;
dee = DEP_PRO (dep1); edge_iterator ei;
if (!NONDEBUG_INSN_P (dee)) /* Assume that region is SCC, i.e. all immediate predecessors
continue; of non-head block are in the same region. */
if (BLOCK_FOR_INSN (dee) != BLOCK_FOR_INSN (first_arg)) FOR_EACH_EDGE (e, ei, bb->preds)
/* Must add dependee for first argument in dee's block. */ {
add_dependee_for_func_arg (first_arg, BLOCK_FOR_INSN (dee)); /* Avoid creating of loop-carried dependencies through
using topological odering in region. */
if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index))
add_dependee_for_func_arg (first_arg, e->src);
}
} }
insn = first_arg; insn = first_arg;
} }
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