]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcse.c (fis_get_condition): Make it a global function.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 12 Jun 2003 04:15:56 +0000 (04:15 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 12 Jun 2003 04:15:56 +0000 (04:15 +0000)
* gcse.c (fis_get_condition): Make it a global function.
* reload1.c (reload_cse_move2add): Detect implicit sets.
* rtl.h: Add a prototype for fis_get_condition.

From-SVN: r67814

gcc/ChangeLog
gcc/gcse.c
gcc/reload1.c
gcc/rtl.h

index ecbb5be3a9b0dc0e7d402ed04dab7e3cefbca636..e7d48447b19b6920b73974062ccb78c6eedb3400 100644 (file)
@@ -1,3 +1,9 @@
+2003-06-12  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * gcse.c (fis_get_condition): Make it a global function.
+       * reload1.c (reload_cse_move2add): Detect implicit sets.
+       * rtl.h: Add a prototype for fis_get_condition.
+
 2003-06-11  Richard Henderson  <rth@redhat.com>
 
        * stmt.c (expand_asm_operands): Don't warn for memories with
index 8050dd13c73dbe9e74ff9799b2e48b54cce65211..0dbe56a63263a6d958d5ab22ab48262cbc6aedfb 100644 (file)
@@ -611,7 +611,6 @@ static int load_killed_in_block_p    PARAMS ((basic_block, int, rtx, int));
 static void canon_list_insert        PARAMS ((rtx, rtx, void *));
 static int cprop_insn          PARAMS ((rtx, int));
 static int cprop               PARAMS ((int));
-static rtx fis_get_condition   PARAMS ((rtx));
 static void find_implicit_sets PARAMS ((void));
 static int one_cprop_pass      PARAMS ((int, int, int));
 static bool constprop_register PARAMS ((rtx, rtx, rtx, int));
@@ -4610,7 +4609,7 @@ cprop (alter_jumps)
    recording the value of *every* register scaned by canonicalize_condition,
    but this would require some code reorganization.  */
 
-static rtx
+rtx
 fis_get_condition (jump)
      rtx jump;
 {
index f8b3d5aef3497722393911b561c2eb577800a025..12f6689eaf19c34c8d553a8e476b025bb2c3580e 100644 (file)
@@ -9314,6 +9314,30 @@ reload_cse_move2add (first)
            }
        }
       note_stores (PATTERN (insn), move2add_note_store, NULL);
+
+      /* If INSN is a conditional branch, we try to extract an
+        implicit set out of it.  */
+      if (any_condjump_p (insn) && onlyjump_p (insn))
+       {
+         rtx cnd = fis_get_condition (insn);
+
+         if (cnd != NULL_RTX
+             && GET_CODE (cnd) == NE
+             && GET_CODE (XEXP (cnd, 0)) == REG
+             /* The following two checks, which are also in
+                move2add_note_store, are intended to reduce the
+                number of calls to gen_rtx_SET to avoid memory
+                allocation if possible.  */
+             && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0)))
+             && HARD_REGNO_NREGS (REGNO (XEXP (cnd, 0)), GET_MODE (XEXP (cnd, 0))) == 1
+             && GET_CODE (XEXP (cnd, 1)) == CONST_INT)
+           {
+             rtx implicit_set =
+               gen_rtx_SET (VOIDmode, XEXP (cnd, 0), XEXP (cnd, 1));
+             move2add_note_store (SET_DEST (implicit_set), implicit_set, 0);
+           }
+       }
+
       /* If this is a CALL_INSN, all call used registers are stored with
         unknown values.  */
       if (GET_CODE (insn) == CALL_INSN)
index 8b2ae092ebbedaa98267369e8401be079bb273cd..85bc64571ecbf82be64c58d393e9664f7f05e575 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2168,6 +2168,7 @@ extern rtx expand_mult_highpart           PARAMS ((enum machine_mode, rtx,
 
 /* In gcse.c */
 extern bool can_copy_p                 PARAMS ((enum machine_mode));
+extern rtx fis_get_condition           PARAMS ((rtx));
 #ifdef BUFSIZ
 extern int gcse_main                   PARAMS ((rtx, FILE *));
 extern int bypass_jumps                        PARAMS ((FILE *));