summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-26 15:30:58 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-26 15:30:58 +0000
commitc08ab9d8ba0f542281abea70f56e94de750e94aa (patch)
tree3c7b669515e0d348d425a8d51b063ae78059d9e9 /gcc
parentd91e38321c9a66c96b90956b077e84e03a4d3822 (diff)
downloadppe42-gcc-c08ab9d8ba0f542281abea70f56e94de750e94aa.tar.gz
ppe42-gcc-c08ab9d8ba0f542281abea70f56e94de750e94aa.zip
* haifa-sched.c (sched_analyze_insn): Only create scheduling
barriers for LOOP, EH and SETJMP notes on the loop_notes list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22005 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/haifa-sched.c52
2 files changed, 38 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4dd980d96a8..62b3bb1676c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -5,6 +5,9 @@ Wed Aug 26 09:30:59 1998 Nick Clifton <nickc@cygnus.com>
Wed Aug 26 12:57:09 1998 Jeffrey A Law (law@cygnus.com)
+ * haifa-sched.c (sched_analyze_insn): Only create scheduling
+ barriers for LOOP, EH and SETJMP notes on the loop_notes list.
+
* mn10300.h (RTX_COSTS): Handle UDIV and UMOD too.
Wed Aug 26 16:35:37 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 0eebda9e38a..12e82d6dfaf 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -3687,36 +3687,54 @@ sched_analyze_insn (x, insn, loop_notes)
sched_analyze_2 (XEXP (link, 0), insn);
}
- /* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic block, then
- we must be sure that no instructions are scheduled across it.
+ /* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic
+ block, then we must be sure that no instructions are scheduled across it.
Otherwise, the reg_n_refs info (which depends on loop_depth) would
become incorrect. */
if (loop_notes)
{
int max_reg = max_reg_num ();
+ int schedule_barrier_found = 0;
rtx link;
- for (i = 0; i < max_reg; i++)
+ /* Update loop_notes with any notes from this insn. Also determine
+ if any of the notes on the list correspond to instruction scheduling
+ barriers (loop, eh & setjmp notes, but not range notes. */
+ link = loop_notes;
+ while (XEXP (link, 1))
{
- rtx u;
- for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- reg_last_uses[i] = 0;
+ if (XINT (link, 0) == NOTE_INSN_LOOP_BEG
+ || XINT (link, 0) == NOTE_INSN_LOOP_END
+ || XINT (link, 0) == NOTE_INSN_EH_REGION_BEG
+ || XINT (link, 0) == NOTE_INSN_EH_REGION_END
+ || XINT (link, 0) == NOTE_INSN_SETJMP)
+ schedule_barrier_found = 1;
- /* reg_last_sets[r] is now a list of insns */
- for (u = reg_last_sets[i]; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), 0);
+ link = XEXP (link, 1);
}
- reg_pending_sets_all = 1;
-
- flush_pending_lists (insn, 0);
-
- link = loop_notes;
- while (XEXP (link, 1))
- link = XEXP (link, 1);
XEXP (link, 1) = REG_NOTES (insn);
REG_NOTES (insn) = loop_notes;
+
+ /* Add dependencies if a scheduling barrier was found. */
+ if (schedule_barrier_found)
+ {
+ for (i = 0; i < max_reg; i++)
+ {
+ rtx u;
+ for (u = reg_last_uses[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ reg_last_uses[i] = 0;
+
+ /* reg_last_sets[r] is now a list of insns */
+ for (u = reg_last_sets[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), 0);
+ }
+ reg_pending_sets_all = 1;
+
+ flush_pending_lists (insn, 0);
+ }
+
}
/* After reload, it is possible for an instruction to have a REG_DEAD note
OpenPOWER on IntegriCloud