OSDN Git Service

* reorg.c (dbr_schedule): At end of this pass, add REG_BR_PRED
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Sep 1997 07:14:07 +0000 (07:14 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Sep 1997 07:14:07 +0000 (07:14 +0000)
        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

gcc/ChangeLog
gcc/reorg.c
gcc/rtl.c
gcc/rtl.h

index f07538f..1964beb 100644 (file)
@@ -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.
index 3686907..28553e6 100644 (file)
@@ -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 */
index 1f2c9dd..b61b95e 100644 (file)
--- 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.  */
index f4d1db9..f95adc5 100644 (file)
--- 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