public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Speedup df_insn_refs_verify
@ 2017-05-22  7:18 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-05-22  7:18 UTC (permalink / raw)
  To: gcc-patches


When not verifying we can actually short-circuit verifying the individual
chains.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2017-05-22  Richard Biener  <rguenther@suse.de>

	* df-scan.c (df_insn_refs_verify): Speedup when not verifying.

Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c	(revision 248263)
+++ gcc/df-scan.c	(working copy)
@@ -4103,23 +4103,31 @@ df_insn_refs_verify (struct df_collectio
                      rtx_insn *insn,
 		     bool abort_if_fail)
 {
-  bool ret1, ret2, ret3, ret4;
+  bool ret1, ret2, ret3;
   unsigned int uid = INSN_UID (insn);
   struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
 
   df_insn_refs_collect (collection_rec, bb, insn_info);
 
+  if (! df_mws_verify (&collection_rec->mw_vec, DF_INSN_UID_MWS (uid),
+		       abort_if_fail))
+    return false;
+
   /* Unfortunately we cannot opt out early if one of these is not
-     right because the marks will not get cleared.  */
+     right and abort_if_fail is set because the marks will not get cleared.  */
   ret1 = df_refs_verify (&collection_rec->def_vec, DF_INSN_UID_DEFS (uid),
 			 abort_if_fail);
+  if (!ret1 && !abort_if_fail)
+    return false;
   ret2 = df_refs_verify (&collection_rec->use_vec, DF_INSN_UID_USES (uid),
 			 abort_if_fail);
+  if (!ret2 && !abort_if_fail)
+    return false;
   ret3 = df_refs_verify (&collection_rec->eq_use_vec, DF_INSN_UID_EQ_USES (uid),
 			 abort_if_fail);
-  ret4 = df_mws_verify (&collection_rec->mw_vec, DF_INSN_UID_MWS (uid),
-		       abort_if_fail);
-  return (ret1 && ret2 && ret3 && ret4);
+  if (!ret3 && !abort_if_fail)
+    return false;
+  return (ret1 && ret2 && ret3);
 }
 
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-22  7:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22  7:18 [PATCH] Speedup df_insn_refs_verify Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).