This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.5] Doloop improvement patches, 2/7
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Bernd Schmidt <bernds_cb1 at t-online dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 6 Mar 2009 00:44:14 +0100
- Subject: Re: [4.5] Doloop improvement patches, 2/7
- References: <49B0520C.20904@t-online.de>
Hi,
> @@ -1853,6 +1853,43 @@ simplify_using_initial_values (struct lo
> SET_REGNO_REG_SET (this_altered, i);
> }
>
> + did_replace = simplify_using_assignment (insn, expr);
> +
> + if (did_replace)
> + {
> + rtx *pnote, *pnote_next;
> + for (pnote = &cond_list; *pnote; pnote = pnote_next)
> + {
> + rtx note = *pnote;
> +
> + pnote_next = &XEXP (note, 1);
> + simplify_using_assignment (insn, &XEXP (note, 0));
> + /* We can no longer use a condition that has been simplified
> + to a constant, and simplify_using_condition will abort if
> + we try. */
> + if (CONSTANT_P (XEXP (note, 0)))
> + {
> + *pnote = *pnote_next;
> + pnote_next = pnote;
> + free_EXPR_LIST_node (note);
> + }
> + }
> + }
The block above should not be guarded by did_replace. Also, it
seems that you should remove the conditions that are invalidated
according to this_altered from the list, unless you perform a
replacement in the condition.
> + if (old != *expr)
Why is this guarded by old != *expr, and not did_replace?
> + {
> + rtx note;
> +
> + if (CONSTANT_P (*expr))
> + goto out;
> + for (note = cond_list; note; note = XEXP (note, 1))
> + {
> + simplify_using_condition (XEXP (note, 0), expr, altered);
> + if (CONSTANT_P (*expr))
> + goto out;
> + }
> + }
Zdenek