Commit 4586b4ca by Steven Bosscher Committed by Steven Bosscher

rtl.c (currently_expanding_to_rtl): New.

	* rtl.c (currently_expanding_to_rtl): New.
	* rtl.h (currently_expanding_to_rtl): Export it.
	* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.

	* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
	inliner hack.
	* config/sh/sh.c: Replace rtx_equal_function_value_matters
	with currently_expanding_to_rtl.
	* config/sh/sh.md: Likewise.
	* config/ia64/ia64.c (got_symbolic_operand): Likewise.

From-SVN: r85287
parent 157371cf
2004-07-29 Steven Bosscher <stevenb@suse.de>
* rtl.c (currently_expanding_to_rtl): New.
* rtl.h (currently_expanding_to_rtl): Export it.
* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
inliner hack.
* config/sh/sh.c: Replace rtx_equal_function_value_matters
with currently_expanding_to_rtl.
* config/sh/sh.md: Likewise.
* config/ia64/ia64.c (got_symbolic_operand): Likewise.
2004-07-29 Alexandre Oliva <aoliva@redhat.com>
Introduce sh2a support.
......
......@@ -433,6 +433,9 @@ tree_expand_cfg (void)
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
}
/* Some backends want to know that we are expanding to RTL. */
currently_expanding_to_rtl = 1;
/* Prepare the rtl middle end to start recording block changes. */
reset_block_changes ();
......@@ -459,6 +462,9 @@ tree_expand_cfg (void)
construct_exit_block ();
/* We're done expanding trees to RTL. */
currently_expanding_to_rtl = 0;
/* Convert from NOTE_INSN_EH_REGION style notes, and do other
sorts of eh initialization. Delay this until after the
initial rtl dump so that we can see the original nesting. */
......
......@@ -2796,23 +2796,6 @@ alpha_expand_mov (enum machine_mode mode, rtx *operands)
{
rtx tmp;
/* With RTL inlining, at -O3, rtl is generated, stored, then actually
compiled at the end of compilation. In the meantime, someone can
re-encode-section-info on some symbol changing it e.g. from global
to local-not-small. If this happens, we'd have emitted a plain
load rather than a high+losum load and not recognize the insn.
So if rtl inlining is in effect, we delay the global/not-global
decision until rest_of_compilation by wrapping it in an
UNSPEC_SYMBOL. */
if (TARGET_EXPLICIT_RELOCS && flag_inline_functions
&& rtx_equal_function_value_matters
&& global_symbolic_operand (operands[1], mode))
{
emit_insn (gen_movdi_er_maybe_g (operands[0], operands[1]));
return true;
}
tmp = alpha_legitimize_address (operands[1], operands[0], mode);
if (tmp)
{
......
......@@ -489,7 +489,7 @@ got_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
/* "Ok" while emitting rtl, since otherwise we won't be provided
with the entire offset during emission, which makes it very
hard to split the offset into high and low parts. */
if (rtx_equal_function_value_matters)
if (currently_expanding_to_rtl)
return 1;
/* Force the low 14 bits of the constant to zero so that we do not
......
......@@ -2286,9 +2286,6 @@ shl_and_scr_length (rtx insn)
return len + shift_insns[INTVAL (XEXP (op, 1))];
}
/* Generating rtl? */
extern int rtx_equal_function_value_matters;
/* Generate rtl for instructions for which shl_and_kind advised a particular
method of generating them, i.e. returned zero. */
......@@ -2359,7 +2356,7 @@ gen_shl_and (rtx dest, rtx left_rtx, rtx mask_rtx, rtx source)
case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (rtx_equal_function_value_matters
if (currently_expanding_to_rtl
|| reload_in_progress || reload_completed)
{
rtx operands[3];
......@@ -2556,7 +2553,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (! rtx_equal_function_value_matters
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
......@@ -2611,7 +2608,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
case 5:
{
int i = 16 - size;
if (! rtx_equal_function_value_matters
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
else
......@@ -2630,7 +2627,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
case 7:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (! rtx_equal_function_value_matters
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
......
......@@ -3459,7 +3459,7 @@
(unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
"TARGET_SH1"
"#"
"&& ! rtx_equal_function_value_matters"
"&& ! currently_expanding_to_rtl"
[(set (match_dup 0) (match_dup 1))]
"
{
......@@ -7476,7 +7476,7 @@ mov.l\\t1f,r0\\n\\
}
if (sh_expand_t_scc (EQ, operands[0]))
DONE;
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
}")
......@@ -7524,7 +7524,7 @@ mov.l\\t1f,r0\\n\\
}
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LT);
}")
......@@ -7628,7 +7628,7 @@ mov.l\\t1f,r0\\n\\
}
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GT);
}")
......@@ -7682,7 +7682,7 @@ mov.l\\t1f,r0\\n\\
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
{
......@@ -7723,7 +7723,7 @@ mov.l\\t1f,r0\\n\\
sh_compare_op0, sh_compare_op1));
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GTU);
}")
......@@ -7749,7 +7749,7 @@ mov.l\\t1f,r0\\n\\
sh_compare_op1, sh_compare_op0));
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LTU);
}")
......@@ -7780,7 +7780,7 @@ mov.l\\t1f,r0\\n\\
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LEU);
}")
......@@ -7812,7 +7812,7 @@ mov.l\\t1f,r0\\n\\
DONE;
}
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GEU);
}")
......@@ -7863,7 +7863,7 @@ mov.l\\t1f,r0\\n\\
if (sh_expand_t_scc (NE, operands[0]))
DONE;
if (! rtx_equal_function_value_matters)
if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
operands[2] = gen_reg_rtx (SImode);
......
......@@ -320,6 +320,10 @@ shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL)
/* Nonzero when we are generating CONCATs. */
int generating_concat_p;
/* Nonzero when we are expanding trees to RTL. */
int currently_expanding_to_rtl;
/* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */
......
......@@ -1543,6 +1543,9 @@ do { \
/* Nonzero when we are generating CONCATs. */
extern int generating_concat_p;
/* Nonzero when we are expanding trees to RTL. */
extern int currently_expanding_to_rtl;
/* Generally useful functions. */
/* In expmed.c */
......
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