diff mbox

[committed] insn_latency takes a pair of rtx_insn *

Message ID 1409864575.19403.25.camel@surprise
State New
Headers show

Commit Message

David Malcolm Sept. 4, 2014, 9:02 p.m. UTC
The attached patch strengthens both params of the generated insn_latency
function from rtx to rtx_insn *, and thus falls under the pre-approval
granted by Jeff here:
  https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01310.html

Bootstrapped on x86_64-unknown-linux-gnu (Fedora 20), and has been
rebuilt as part of a config-list.mk build for all working configurations
(albeit with other patches for the latter case).

Committed to trunk as r214921.
diff mbox

Patch

Index: gcc/genautomata.c
===================================================================
--- gcc/genautomata.c	(revision 214920)
+++ gcc/genautomata.c	(revision 214921)
@@ -8477,16 +8477,10 @@ 
 static void
 output_insn_latency_func (void)
 {
-  fprintf (output_file, "int\n%s (rtx uncast_%s, rtx uncast_%s)\n",
+  fprintf (output_file, "int\n%s (rtx_insn *%s, rtx_insn *%s)\n",
 	   INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
   fprintf (output_file, "{\n  int %s, %s;\n",
 	   INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME);
-  fprintf (output_file,
-	   "  rtx_insn *%s = safe_as_a <rtx_insn *> (uncast_%s);\n",
-	   INSN_PARAMETER_NAME, INSN_PARAMETER_NAME);
-  fprintf (output_file,
-	   "  rtx_insn *%s = safe_as_a <rtx_insn *> (uncast_%s);\n",
-	   INSN2_PARAMETER_NAME, INSN2_PARAMETER_NAME);
   output_internal_insn_code_evaluation (INSN_PARAMETER_NAME,
 					INTERNAL_INSN_CODE_NAME, 0);
   output_internal_insn_code_evaluation (INSN2_PARAMETER_NAME,
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 214920)
+++ gcc/ChangeLog	(revision 214921)
@@ -1,5 +1,14 @@ 
 2014-09-04  David Malcolm  <dmalcolm@redhat.com>
 
+	* genattr.c (main): Within the prototype of insn_latency written
+	out to insn-attr.h, strengthen both params from rtx to rtx_insn *.
+	* genautomata.c (output_internal_maximal_insn_latency_func):
+	Within the implementation of insn_latency written out to
+	insn-automata.c, strengthen both params from rtx to rtx_insn *,
+	eliminating a pair of checked casts.
+
+2014-09-04  David Malcolm  <dmalcolm@redhat.com>
+
 	* jump.c (eh_returnjump_p): Strengthen param "insn" from rtx to
 	rtx_insn *.
 
Index: gcc/genattr.c
===================================================================
--- gcc/genattr.c	(revision 214920)
+++ gcc/genattr.c	(revision 214921)
@@ -248,7 +248,7 @@ 
       printf ("/* Insn latency time on data consumed by the 2nd insn.\n");
       printf ("   Use the function if bypass_p returns nonzero for\n");
       printf ("   the 1st insn. */\n");
-      printf ("extern int insn_latency (rtx, rtx);\n\n");
+      printf ("extern int insn_latency (rtx_insn *, rtx_insn *);\n\n");
       printf ("/* Maximal insn latency time possible of all bypasses for this insn.\n");
       printf ("   Use the function if bypass_p returns nonzero for\n");
       printf ("   the 1st insn. */\n");