biv elimination patch
Joern Rennecke
amylaar@cygnus.co.uk
Mon Mar 29 10:06:00 GMT 1999
Currently, we inhibit biv elimination when a bivis used inside a libcall
for anything but directly setting a giv, even if the purpose of the entire
libcall is only to set a giv.
Here is a fix:
Mon Mar 29 19:02:12 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* loop.c (maybe_eliminate_biv): For libcalls that set a giv, skip to
end of libcall.
*** loop.c-1999032620 Fri Mar 26 20:09:56 1999
--- loop.c Mon Mar 29 18:47:08 1999
*************** maybe_eliminate_biv (bl, loop_start, end
*** 8417,8422 ****
--- 8422,8447 ----
enum rtx_code code = GET_CODE (p);
rtx where = threshold >= insn_count ? loop_start : p;
+ /* If this is a libcall that sets a giv, skip ahead to its end. */
+ if (GET_RTX_CLASS (code) == 'i')
+ {
+ rtx note = find_reg_note (p, REG_LIBCALL, NULL_RTX);
+
+ if (note)
+ {
+ rtx last = XEXP (note, 0);
+ rtx set = single_set (last);
+
+ if (set && GET_CODE (SET_DEST (set)) == REG)
+ {
+ int regno = REGNO (SET_DEST (set));
+
+ if (REG_IV_TYPE (regno) == GENERAL_INDUCT
+ && REG_IV_INFO (regno)->src_reg == bl->biv->src_reg)
+ p = last;
+ }
+ }
+ }
if ((code == INSN || code == JUMP_INSN || code == CALL_INSN)
&& reg_mentioned_p (reg, PATTERN (p))
&& ! maybe_eliminate_biv_1 (PATTERN (p), p, bl, eliminate_p, where))
More information about the Gcc-patches
mailing list