From patchwork Tue Oct 14 14:15:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 399474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 11DB41400DD for ; Wed, 15 Oct 2014 01:19:11 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=Sh5HYrolW56UzqnMj/Ezloemis753C+P6pR1PJ9KWQYc0GCRKzH0T SRSi045pPQlj6IMid2oCUv/6uZ6Gn4irDvpYYKmbDtFGRnCNq+kXr2wbTfmi5egi ZbE8qwqOVVVa5pww/k2sE9QTne1/IrbUbmpW9zNGhMlhRDpYOXJHo4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=ZJoM+D3LRKRv4n5BCLJeINaRHCQ=; b=HiBeIaxigGgPotmYxeDh Bf1LPeL0cyUIBCt+t5iryKGjJSOJEYN9VkwqEf76uvNp15Whma+uuU44xHNRTD6E v8AQF8stgQ1iY2WNJfTA/zM1BDNsuQNyr4sM+R5amiVd+f8cWBL5jpq1isSK8ulq IahDhxaPusVJzlpdZbFKZ1g= Received: (qmail 29402 invoked by alias); 14 Oct 2014 14:19:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29389 invoked by uid 89); 14 Oct 2014 14:19:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 14 Oct 2014 14:19:03 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 384C4AB07 for ; Tue, 14 Oct 2014 14:19:00 +0000 (UTC) Date: Tue, 14 Oct 2014 16:15:02 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH][match-and-simplify] Remove/revert unneeded changes Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 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 * 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. 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