Commit 2adc9b0f by Roger Sayle Committed by Roger Sayle

builtins.c (purge_builtin_constant_p): Scan insn stream sequentially rather than by basic block.


	* builtins.c (purge_builtin_constant_p): Scan insn stream
	sequentially rather than by basic block.
	* function.c (purge_addressof): Simplify test with INSN_P.

From-SVN: r61789
parent ad487c38
2002-01-25 Roger Sayle <roger@eyesopen.com>
* builtins.c (purge_builtin_constant_p): Scan insn stream
sequentially rather than by basic block.
* function.c (purge_addressof): Simplify test with INSN_P.
2003-01-25 Kazu Hirata <kazu@cs.umass.edu> 2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (simplify_comparison, case AND): Remove a redundant * combine.c (simplify_comparison, case AND): Remove a redundant
......
...@@ -4720,26 +4720,20 @@ default_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -4720,26 +4720,20 @@ default_expand_builtin (exp, target, subtarget, mode, ignore)
void void
purge_builtin_constant_p () purge_builtin_constant_p ()
{ {
rtx insn, done, set; rtx insn, set, arg, new, note;
rtx arg, new, note;
basic_block bb;
FOR_EACH_BB (bb) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ if (INSN_P (insn)
done = NEXT_INSN (bb->end); && (set = single_set (insn)) != NULL_RTX
for (insn = bb->head; insn != done; insn = NEXT_INSN (insn)) && GET_CODE (SET_SRC (set)) == CONSTANT_P_RTX)
if (INSN_P (insn) {
&& (set = single_set (insn)) != NULL_RTX arg = XEXP (SET_SRC (set), 0);
&& GET_CODE (SET_SRC (set)) == CONSTANT_P_RTX) new = CONSTANT_P (arg) ? const1_rtx : const0_rtx;
{ validate_change (insn, &SET_SRC (set), new, 0);
arg = XEXP (SET_SRC (set), 0);
new = CONSTANT_P (arg) ? const1_rtx : const0_rtx;
validate_change (insn, &SET_SRC (set), new, 0);
/* Remove the REG_EQUAL note from the insn. */ /* Remove the REG_EQUAL note from the insn. */
if ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0) if ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0)
remove_note (insn, note); remove_note (insn, note);
} }
}
} }
...@@ -3372,8 +3372,7 @@ purge_addressof (insns) ...@@ -3372,8 +3372,7 @@ purge_addressof (insns)
compute_insns_for_mem (insns, NULL_RTX, ht); compute_insns_for_mem (insns, NULL_RTX, ht);
for (insn = insns; insn; insn = NEXT_INSN (insn)) for (insn = insns; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN if (INSN_P (insn))
|| GET_CODE (insn) == CALL_INSN)
{ {
if (! purge_addressof_1 (&PATTERN (insn), insn, if (! purge_addressof_1 (&PATTERN (insn), insn,
asm_noperands (PATTERN (insn)) > 0, 0, ht)) asm_noperands (PATTERN (insn)) > 0, 0, ht))
......
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