#include "hard-reg-set.h"
#include "basic-block.h"
#include "predict.h"
+#include "params.h"
/* The prime factors looked for when trying to unroll a loop by some
number which is modulo the total number of iterations. Just checking
UNROLL_NAIVE
};
-/* This controls which loops are unrolled, and by how much we unroll
- them. */
-
-#ifndef MAX_UNROLLED_INSNS
-#define MAX_UNROLLED_INSNS 100
-#endif
-
/* Indexed by register number, if non-zero, then it contains a pointer
to a struct induction for a DEST_REG giv which has been combined with
one of more address givs. This is needed because whenever such a DEST_REG
if (max_labelno > 0)
{
- map->label_map = (rtx *) xmalloc (max_labelno * sizeof (rtx));
-
+ map->label_map = (rtx *) xcalloc (max_labelno, sizeof (rtx));
local_label = (char *) xcalloc (max_labelno, sizeof (char));
}
rtx second_part = XEXP (increment, 1);
enum rtx_code code = GET_CODE (increment);
- increment = find_last_value (XEXP (increment, 0),
+ increment = find_last_value (XEXP (increment, 0),
&src_insn, NULL_RTX, 0);
/* Don't need the last insn anymore. */
delete_related_insns (get_last_insn ());
while (*notesp)
{
rtx note = *notesp;
-
+
if (GET_CODE (note) == INSN_LIST)
{
/* Sometimes, we have a REG_WAS_0 note that points to a
pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
copy = emit_call_insn (pattern);
REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
+ SIBLING_CALL_P (copy) = SIBLING_CALL_P (insn);
/* Because the USAGE information potentially contains objects other
than hard registers, we need to copy it. */
rtx tem = gen_reg_rtx (bl->biv->mode);
record_base_value (REGNO (tem), bl->biv->add_val, 0);
- loop_insn_hoist (loop,
+ loop_insn_hoist (loop,
gen_move_insn (tem, bl->biv->src_reg));
if (loop_dump_stream)
&& INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
{
if (loop_dump_stream)
- fprintf
+ fprintf
(loop_dump_stream,
"Loop iterations: Loop has multiple back edges.\n");
return 0;
for (biv_inc = bl->biv; biv_inc; biv_inc = biv_inc->next_iv)
{
if (loop_insn_first_p (v->insn, biv_inc->insn))
- offset -= INTVAL (biv_inc->add_val);
+ {
+ if (REG_P (biv_inc->add_val))
+ {
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream,
+ "Loop iterations: Basic induction var add_val is REG %d.\n",
+ REGNO (biv_inc->add_val));
+ return 0;
+ }
+
+ offset -= INTVAL (biv_inc->add_val);
+ }
}
}
if (loop_dump_stream)