This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dataflow patch] DCE const/pure calls


This patch allows DCE to mark const or pure calls as eliminatable. Together with other patches, I can then get rid of libcall notes on i386 at least.

Bootstrapped/regtested i686-pc-linux-gnu; ok for branch?

Paolo
2007-05-08  Paolo Bonzini  <bonzini@gnu.org>

	* dce.c (deletable_insn_p): Const or pure calls are deletable.

Index: dce.c
===================================================================
--- dce.c	(revision 124539)
+++ dce.c	(working copy)
@@ -96,16 +96,16 @@ deletable_insn_p (rtx insn, bool fast)
 	return false;
 
     default:
-      if (!NONJUMP_INSN_P (insn))
-	return false;
-
       if (volatile_insn_p (PATTERN (insn)))
 	return false;
 
       if (flag_non_call_exceptions && may_trap_p (PATTERN (insn)))
 	return false;
 
-      return true;
+      if (CALL_P (insn) && CONST_OR_PURE_CALL_P (insn))
+	return true;
+
+      return NONJUMP_INSN_P (insn);
     }
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]