summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-09-23 07:14:07 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-09-23 07:14:07 +0000
commit4816399963ee82660f4e818a049d4f16d09aa64d (patch)
treebacbc60b12bc81575fde04ef6114280a5e5fbc54
parentf71e5a0252c18f3d2f112e4396e7d57d127df1d1 (diff)
downloadgcc-4816399963ee82660f4e818a049d4f16d09aa64d.tar.gz
* reorg.c (dbr_schedule): At end of this pass, add REG_BR_PRED
note holding get_jump_flags() calculation to all JUMP_INSNs. * rtl.h (enum reg_note): New note types REG_BR_PRED and REG_SAVE_AREA. * rtl.c (reg_note_name): Add new note types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15670 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/reorg.c17
-rw-r--r--gcc/rtl.c3
-rw-r--r--gcc/rtl.h10
4 files changed, 34 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f07538faee1..1964beb7f8b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Tue Sep 23 01:15:50 1997 David S. Miller <davem@tanya.rutgers.edu>
+
+ * reorg.c (dbr_schedule): At end of this pass, add REG_BR_PRED
+ note holding get_jump_flags() calculation to all JUMP_INSNs.
+ * rtl.h (enum reg_note): New note types REG_BR_PRED and REG_SAVE_AREA.
+ * rtl.c (reg_note_name): Add new note types.
+
Tue Sep 23 00:59:54 1997 Jeffrey A Law (law@cygnus.com)
* rtlanal.c (computed_jump_p): Fix typo in last change.
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 3686907ded4..28553e6583d 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -4617,5 +4617,22 @@ dbr_schedule (first, file)
}
}
}
+
+ /* For all JUMP insns, fill in branch prediction notes, so that during
+ assembler output a target can set branch prediction bits in the code.
+ We have to do this now, as up until this point the destinations of
+ JUMPS can be moved around and changed, but past right here that cannot
+ happen. */
+ for (insn = first; insn; insn = NEXT_INSN (insn))
+ {
+ int pred_flags;
+
+ if (GET_CODE (insn) != JUMP_INSN)
+ continue;
+
+ pred_flags = get_jump_flags (insn, JUMP_LABEL (insn));
+ REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_BR_PRED,
+ GEN_INT (pred_flags), REG_NOTES (insn));
+ }
}
#endif /* DELAY_SLOTS */
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 1f2c9dde0ff..b61b95ee352 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -181,7 +181,8 @@ char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
"REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED",
"REG_CC_SETTER", "REG_CC_USER", "REG_LABEL",
"REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB",
- "REG_EXEC_COUNT", "REG_NOALIAS" };
+ "REG_EXEC_COUNT", "REG_NOALIAS", "REG_SAVE_AREA",
+ "REG_BR_PRED" };
/* Allocate an rtx vector of N elements.
Store the length, and initialize all elements to zero. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index f4d1db90141..f95adc5735d 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -307,7 +307,12 @@ typedef struct rtvec_def{
probability that this call won't return.
REG_EXEC_COUNT is attached to the first insn of each basic block, and
the first insn after each CALL_INSN. It indicates how many times this
- block was executed. */
+ block was executed.
+ REG_SAVE_AREA is used to optimize rtl generated by dynamic stack
+ allocations for targets where SETJMP_VIA_SAVE_AREA is true.
+ REG_BR_PRED is attached to JUMP_INSNs only, it holds the branch prediction
+ flags computed by get_jump_flags() after dbr scheduling is complete. */
+
#define REG_NOTES(INSN) ((INSN)->fld[6].rtx)
@@ -317,7 +322,8 @@ enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4,
REG_NONNEG = 8, REG_NO_CONFLICT = 9, REG_UNUSED = 10,
REG_CC_SETTER = 11, REG_CC_USER = 12, REG_LABEL = 13,
REG_DEP_ANTI = 14, REG_DEP_OUTPUT = 15, REG_BR_PROB = 16,
- REG_EXEC_COUNT = 17, REG_NOALIAS = 18 };
+ REG_EXEC_COUNT = 17, REG_NOALIAS = 18, REG_SAVE_AREA = 19,
+ REG_BR_PRED = 20 };
/* The base value for branch probability notes. */
#define REG_BR_PROB_BASE 10000