This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[dataflow patch] DCE const/pure calls
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Steven Bosscher <stevenb dot gcc at gmail dot com>, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Tue, 08 May 2007 11:45:01 +0200
- Subject: [dataflow patch] DCE const/pure calls
- Reply-to: bonzini at gnu dot org
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);
}
}