[llvm-commits] [llvm-gcc-4.2] r51654 - in /llvm-gcc-4.2/trunk/gcc: genattrtab.c genautomata.c

Dale Johannesen dalej at apple.com
Wed May 28 14:56:36 PDT 2008


Author: johannes
Date: Wed May 28 16:56:36 2008
New Revision: 51654

URL: http://llvm.org/viewvc/llvm-project?rev=51654&view=rev
Log:
Remove more unneeded code.


Modified:
    llvm-gcc-4.2/trunk/gcc/genattrtab.c
    llvm-gcc-4.2/trunk/gcc/genautomata.c

Modified: llvm-gcc-4.2/trunk/gcc/genattrtab.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/genattrtab.c?rev=51654&r1=51653&r2=51654&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/genattrtab.c (original)
+++ llvm-gcc-4.2/trunk/gcc/genattrtab.c Wed May 28 16:56:36 2008
@@ -4498,9 +4498,9 @@
 	  }
     }
 
-  make_internal_attr ("*internal_dfa_insn_code", code_exp, ATTR_NONE);
 /* LLVM LOCAL begin */
 #ifndef ENABLE_LLVM
+  make_internal_attr ("*internal_dfa_insn_code", code_exp, ATTR_NONE);
   make_internal_attr ("*insn_default_latency",   lats_exp, ATTR_NONE);
   make_internal_attr ("*bypass_p",               byps_exp, ATTR_NONE);
 #endif

Modified: llvm-gcc-4.2/trunk/gcc/genautomata.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/genautomata.c?rev=51654&r1=51653&r2=51654&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/genautomata.c (original)
+++ llvm-gcc-4.2/trunk/gcc/genautomata.c Wed May 28 16:56:36 2008
@@ -6720,6 +6720,8 @@
   return result;
 }
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The function outputs all initialization values of VECT.  */
 static void
 output_vect (vla_hwint_t vect)
@@ -6745,7 +6747,8 @@
 	els_on_line++;
       }
 }
-
+#endif
+/* LLVM LOCAL end */
 /* The following is name of the structure which represents DFA(s) for
    PHR.  */
 #define CHIP_NAME "DFA_chip"
@@ -6762,6 +6765,8 @@
              automaton->corresponding_automaton_decl->name);
 }
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The following is name of temporary variable which stores state of a
    DFA for PHR.  */
 static void
@@ -6770,12 +6775,16 @@
   fprintf (f, "_");
   output_chip_member_name (f, automaton);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* This is name of macro value which is code of pseudo_insn
    representing advancing cpu cycle.  Its value is used as internal
    code unknown insn.  */
 #define ADVANCE_CYCLE_VALUE_NAME "DFA__ADVANCE_CYCLE"
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* Output name of translate vector for given automaton.  */
 static void
 output_translate_vect_name (FILE *f, automaton_t automaton)
@@ -6841,6 +6850,8 @@
     fprintf (f, "%s_min_issue_delay",
              automaton->corresponding_automaton_decl->name);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* Output name of deadlock vector for given automaton.  */
 static void
@@ -6985,6 +6996,8 @@
 }
 
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The function outputs translate vector of internal insn code into
    insn equivalence class number.  The equivalence class number is
    used to access to table and vectors representing DFA(s).  */
@@ -7018,7 +7031,6 @@
   fprintf (output_file, "};\n\n");
   VEC_free (vect_el_t,heap, translate_vect);
 }
-
 /* The value in a table state x ainsn -> something which represents
    undefined value.  */
 static int undefined_vect_el_value;
@@ -7382,6 +7394,8 @@
   VEC_free (state_t,heap, output_states_vect);
   VEC_free (vect_el_t,heap, transition_vect);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* The current number of passing states to find minimal issue delay
    value for an ainsn and state.  */
@@ -7430,6 +7444,8 @@
   return min_insn_issue_delay;
 }
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The function searches minimal issue delay value for AINSN in STATE.
    The function can return negative value if we can not issue AINSN.  We
    will report about it later.  */
@@ -7658,6 +7674,8 @@
   fprintf (output_file, "\n#define %s %d\n\n", ADVANCE_CYCLE_VALUE_NAME,
            DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* The function outputs definition and value of PHR interface variable
    `max_insn_queue_index'.  Its value is not less than maximal queue
@@ -7692,6 +7710,8 @@
 	   (1 << i) - 1);
 }
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The function outputs switch cases for insn reservations using
    function *output_automata_list_code.  */
 static void
@@ -7939,13 +7959,16 @@
   fprintf (output_file, "    }\n  else\n    %s = %s;\n\n",
 	   insn_code_name, ADVANCE_CYCLE_VALUE_NAME);
 }
-
+#endif
+/* LLVM LOCAL end */
 
 /* This function outputs `dfa_insn_code' and its helper function
    `dfa_insn_code_enlarge'.  */
 static void
 output_dfa_insn_code_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
   /* Emacs c-mode gets really confused if there's a { or } in column 0
      inside a string, so don't do that.  */
   fprintf (output_file, "\
@@ -7988,12 +8011,22 @@
 	   INTERNAL_DFA_INSN_CODE_FUNC_NAME, INSN_PARAMETER_NAME,
 	   DFA_INSN_CODES_VARIABLE_NAME, INTERNAL_INSN_CODE_NAME);
   fprintf (output_file, "  return %s;\n}\n\n", INTERNAL_INSN_CODE_NAME);
+#endif
+/* LLVM LOCAL end */
 }
 
 /* The function outputs PHR interface function `state_transition'.  */
 static void
 output_trans_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifdef ENABLE_LLVM
+  fprintf (output_file, 
+           "int\n%s (%s %s ATTRIBUTE_UNUSED, rtx %s ATTRIBUTE_UNUSED)\n"
+           "{ return -1; }\n",
+	   TRANSITION_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
+	   INSN_PARAMETER_NAME);
+#else
   fprintf (output_file, "int\n%s (%s %s, rtx %s)\n",
 	   TRANSITION_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
 	   INSN_PARAMETER_NAME);
@@ -8002,12 +8035,22 @@
 					INTERNAL_INSN_CODE_NAME, -1);
   fprintf (output_file, "  return %s (%s, %s);\n}\n\n",
 	   INTERNAL_TRANSITION_FUNC_NAME, INTERNAL_INSN_CODE_NAME, STATE_NAME);
+#endif
+/* LLVM LOCAL end */
 }
 
 /* Output function `min_issue_delay'.  */
 static void
 output_min_issue_delay_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifdef ENABLE_LLVM
+  fprintf (output_file, 
+           "int\n%s (%s %s ATTRIBUTE_UNUSED, rtx %s ATTRIBUTE_UNUSED)\n"
+           "{ return -1;}\n",
+	   MIN_ISSUE_DELAY_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
+	   INSN_PARAMETER_NAME);
+#else
   fprintf (output_file, "int\n%s (%s %s, rtx %s)\n",
 	   MIN_ISSUE_DELAY_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
 	   INSN_PARAMETER_NAME);
@@ -8023,6 +8066,8 @@
 	   INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
 	   STATE_NAME);
   fprintf (output_file, "}\n\n");
+#endif
+/* LLVM LOCAL end */
 }
 
 /* Output function `internal_dead_lock'.  */
@@ -8090,6 +8135,14 @@
 static void
 output_min_insn_conflict_delay_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifdef ENABLE_LLVM
+  fprintf (output_file,
+	   "int\n%s (%s %s ATTRIBUTE_UNUSED, rtx %s ATTRIBUTE_UNUSED, "
+           "rtx %s ATTRIBUTE_UNUSED)\n{ return -1; }\n",
+	   MIN_INSN_CONFLICT_DELAY_FUNC_NAME, STATE_TYPE_NAME,
+	   STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
+#else
   fprintf (output_file,
 	   "int\n%s (%s %s, rtx %s, rtx %s)\n",
 	   MIN_INSN_CONFLICT_DELAY_FUNC_NAME, STATE_TYPE_NAME,
@@ -8111,8 +8164,12 @@
 	   INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN2_CODE_NAME,
 	   CHIP_NAME);
   fprintf (output_file, "}\n\n");
+#endif
+/* LLVM LOCAL end */
 }
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* Output function `internal_insn_latency'.  */
 static void
 output_internal_insn_latency_func (void)
@@ -8207,11 +8264,20 @@
   fprintf (output_file, "    }\n  return default_latencies[%s];\n}\n\n",
 	   INTERNAL_INSN_CODE_NAME);
 }
+#endif
+/* LLVM LOCAL end */
 
 /* The function outputs PHR interface function `insn_latency'.  */
 static void
 output_insn_latency_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifdef ENABLE_LLVM
+  fprintf (output_file, 
+           "int\n%s (rtx %s ATTRIBUTE_UNUSED, rtx %s ATTRIBUTE_UNUSED)\n"
+           "{ return -1; }\n",
+	   INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
+#else
   fprintf (output_file, "int\n%s (rtx %s, rtx %s)\n",
 	   INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
   fprintf (output_file, "{\n  int %s, %s;\n",
@@ -8224,12 +8290,22 @@
 	   INTERNAL_INSN_LATENCY_FUNC_NAME,
 	   INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME,
 	   INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
+#endif
+/* LLVM LOCAL end */
 }
 
 /* The function outputs PHR interface function `print_reservation'.  */
 static void
 output_print_reservation_func (void)
 {
+/* LLVM LOCAL begin remove unneeded code */
+#ifdef ENABLE_LLVM
+  fprintf (output_file,
+	   "void\n%s (FILE *%s ATTRIBUTE_UNUSED, rtx %s ATTRIBUTE_UNUSED)\n"
+           "{}\n",
+           PRINT_RESERVATION_FUNC_NAME, FILE_PARAMETER_NAME,
+           INSN_PARAMETER_NAME);
+#else
   decl_t decl;
   int i, j;
 
@@ -8283,6 +8359,8 @@
 
   fprintf (output_file, "  fputs (reservation_names[%s], %s);\n}\n\n",
 	   INTERNAL_INSN_CODE_NAME, FILE_PARAMETER_NAME);
+#endif
+/* LLVM LOCAL end */
 }
 
 /* The following function is used to sort unit declaration by their
@@ -8770,6 +8848,8 @@
 /* The page contains top level function for generation DFA(s) used for
    PHR.  */
 
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
 /* The function outputs statistics about work of different phases of
    DFA generator.  */
 static void
@@ -8837,6 +8917,8 @@
   fprintf (f, "%5d all locked states\n", locked_states);
 #endif
 }
+#endif
+/* LLVM LOCAL end */
 
 /* The function output times of work of different phases of DFA
    generator.  */
@@ -9153,7 +9235,11 @@
   output_time = create_ticker ();
   if (progress_flag)
     fprintf (stderr, "Forming and outputting automata tables...");
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
   output_tables ();
+#endif
+/* LLVM LOCAL end */
   if (progress_flag)
     {
       fprintf (stderr, "done\n");
@@ -9161,8 +9247,12 @@
     }
   output_chip_definitions ();
   output_max_insn_queue_index_def ();
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
   output_internal_min_issue_delay_func ();
   output_internal_trans_func ();
+#endif
+/* LLVM LOCAL end */
   /* Cache of insn dfa codes: */
   fprintf (output_file, "\nstatic int *%s;\n", DFA_INSN_CODES_VARIABLE_NAME);
   fprintf (output_file, "\nstatic int %s;\n\n",
@@ -9176,7 +9266,11 @@
   output_internal_reset_func ();
   output_reset_func ();
   output_min_insn_conflict_delay_func ();
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
   output_internal_insn_latency_func ();
+#endif
+/* LLVM LOCAL end */
   output_insn_latency_func ();
   output_print_reservation_func ();
   /* Output function get_cpu_unit_code.  */
@@ -9204,9 +9298,17 @@
       output_automaton_descriptions ();
       if (progress_flag)
 	fprintf (stderr, "done\n");
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
       output_statistics (output_description_file);
+#endif
+/* LLVM LOCAL end */
     }
+/* LLVM LOCAL begin remove unneeded code */
+#ifndef ENABLE_LLVM
   output_statistics (stderr);
+#endif
+/* LLVM LOCAL end */
   ticker_off (&output_time);
   output_time_statistics (stderr);
   finish_states ();





More information about the llvm-commits mailing list