diff mbox

[match-and-simplify] Remove/revert unneeded changes

Message ID alpine.LSU.2.11.1410141613460.20733@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Oct. 14, 2014, 2:15 p.m. UTC
This removes duplicate/not needed code from generic-match-head.c
and removes integral_op_p (if needed these new predicates should
go to tree.h).  It also revers one unnecessary Makefile.in change.

Applied.

Richard.

2014-10-14  Richard Biener  <rguenther@suse.de>

	* Makefile.in (BUILD_RTL): Revert not needed change.
	* match.pd (integral_op_p): Remove predicate and use.
	* generic-match-head.c: Include gimple-match.h and remove
	all code.
	* gimple-match-head.c (integral_op_p): Remove.
diff mbox

Patch

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 216146)
+++ gcc/Makefile.in	(working copy)
@@ -1032,7 +1032,7 @@  BUILD_LIBS = $(BUILD_LIBIBERTY)
 
 BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
 	    build/vec.o build/min-insn-modes.o build/gensupport.o \
-	    build/print-rtl.o build/hash-table.o
+	    build/print-rtl.o
 BUILD_MD = build/read-md.o
 BUILD_ERRORS = build/errors.o
 
Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 216146)
+++ gcc/match.pd	(working copy)
@@ -24,7 +24,6 @@  along with GCC; see the file COPYING3.
 
 /* Generic tree predicates we inherit.  */
 (define_predicates
-   integral_op_p
    integer_onep integer_zerop integer_all_onesp
    real_zerop real_onep
    CONSTANT_CLASS_P)
@@ -132,8 +131,9 @@  (define_predicates
 
 /* fold_negate_exprs convert - (~A) to A + 1.  */
 (simplify
-  (negate (bit_not integral_op_p@0))
-  (plus @0 { build_int_cst (TREE_TYPE (@0), 1); } ))
+  (negate (bit_not @0))
+  (if (INTEGRAL_TYPE_P (type))
+   (plus @0 { build_int_cst (TREE_TYPE (@0), 1); } )))
 
 /* One ternary pattern.  */
 
Index: gcc/generic-match-head.c
===================================================================
--- gcc/generic-match-head.c	(revision 216146)
+++ gcc/generic-match-head.c	(working copy)
@@ -41,37 +41,6 @@  along with GCC; see the file COPYING3.
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
 #include "dumpfile.h"
+#include "gimple-match.h"
 
-#define INTEGER_CST_P(node) (TREE_CODE(node) == INTEGER_CST)
-#define integral_op_p(node) INTEGRAL_TYPE_P(TREE_TYPE(node))
-#define REAL_CST_P(node) (TREE_CODE(node) == REAL_CST)
 
-
-/* Helper to transparently allow tree codes and builtin function codes
-   exist in one storage entity.  */
-class code_helper
-{
-public:
-  code_helper () {}
-  code_helper (tree_code code) : rep ((int) code) {}
-  code_helper (built_in_function fn) : rep (-(int) fn) {}
-  operator tree_code () const { return (tree_code) rep; }
-  operator built_in_function () const { return (built_in_function) -rep; }
-  bool is_tree_code () const { return rep > 0; }
-  bool is_fn_code () const { return rep < 0; }
-private:
-  int rep;
-};
-
-
-/* Return whether T is a constant that we'll dispatch to fold to
-   evaluate fully constant expressions.  */
-
-static inline bool
-constant_for_folding (tree t)
-{
-  return (CONSTANT_CLASS_P (t)
-	  /* The following is only interesting to string builtins.  */
-	  || (TREE_CODE (t) == ADDR_EXPR
-	      && TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST));
-}
Index: gcc/gimple-match-head.c
===================================================================
--- gcc/gimple-match-head.c	(revision 216146)
+++ gcc/gimple-match-head.c	(working copy)
@@ -43,8 +43,6 @@  along with GCC; see the file COPYING3.
 #include "dumpfile.h"
 #include "gimple-match.h"
 
-#define integral_op_p(node) INTEGRAL_TYPE_P(TREE_TYPE(node))
-
 
 /* Forward declarations of the private auto-generated matchers.
    They expect valueized operands in canonical order and do not