+Wed Mar 6 18:14:43 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * cfgcleanup.c (mentions_nonequal_regs): New function.
+ (thread_jump): Use it.
+ * toplev.c (rest_of_compilation): Run jump threading after
+ liveness.
+
2002-03-06 Jakub Jelinek <jakub@redhat.com>
* ssa-ccp.c (ssa_ccp_substitute_constants): Backout 2002-03-05
static bool mark_effect PARAMS ((rtx, bitmap));
static void notice_new_block PARAMS ((basic_block));
static void update_forwarder_flag PARAMS ((basic_block));
+static int mentions_nonequal_regs PARAMS ((rtx *, void *));
\f
/* Set flags for newly created block. */
return false;
}
}
+
+/* Return nonzero if X is an register set in regset DATA.
+ Called via for_each_rtx. */
+static int
+mentions_nonequal_regs (x, data)
+ rtx *x;
+ void *data;
+{
+ regset nonequal = (regset) data;
+ if (REG_P (*x))
+ {
+ int regno;
+
+ regno = REGNO (*x);
+ if (REGNO_REG_SET_P (nonequal, regno))
+ return 1;
+ if (regno < FIRST_PSEUDO_REGISTER)
+ {
+ int n = HARD_REGNO_NREGS (regno, GET_MODE (*x));
+ while (--n > 0)
+ if (REGNO_REG_SET_P (nonequal, regno + n))
+ return 1;
+ }
+ }
+ return 0;
+}
/* Attempt to prove that the basic block B will have no side effects and
allways continues in the same edge if reached via E. Return the edge
if exist, NULL otherwise. */
if (failed)
goto failed_exit;
+ /* cond2 must not mention any register that is not equal to the
+ former block. */
+ if (for_each_rtx (&cond2, mentions_nonequal_regs, nonequal))
+ goto failed_exit;
+
/* In case liveness information is available, we need to prove equivalence
only of the live values. */
if (mode & CLEANUP_UPDATE_LIFE)
#endif
life_analysis (insns, rtl_dump_file, PROP_FINAL);
if (optimize)
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
+ cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
+ | (flag_thread_jumps ? CLEANUP_THREADING : 0));
timevar_pop (TV_FLOW);
no_new_pseudos = 1;