From patchwork Fri Aug 19 06:59:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 660756 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 3sFv3n2SS2z9t1G for ; Fri, 19 Aug 2016 17:00:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uyAEthek; dkim-atps=neutral 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=CYHfnicnRsP0ap/ag4BAmp8xDDtdx+g1Nb3Xla9wphWd9n6w9orEU nJFYKwqPJQ74Z1306HEE2n+QrgQfn1ZplA0a3PWtAV+/kXNsIewKIPdX0ai5eV2d Yn/NAqTv9IIvPdapEvrAhPbAvCb++Gu7kQkbdolcGJRSKQVe4uGWcs= 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=v79GHLl2OmfblL64k5e7yV/Ao2A=; b=uyAEthekslyoq6gWi5qu f7J+rirEHFB5fBgd4f53l33NMX7azz5OXgI7EXeZAiFvleviNdZZsZUXjARQZvUW ad8VPUULah9lkVXXN5+GbcJOr+SZqzwzCrVAmyYxsRpDqE8PqKMVwfmw5D3krxSE IStS9jLfGoJB0kPQUxSQhzU= Received: (qmail 79506 invoked by alias); 19 Aug 2016 06:59:57 -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 79497 invoked by uid 89); 19 Aug 2016 06:59:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:751, matchpd, UD:pd, match.pd X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Aug 2016 06:59:46 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C71C7AAAD for ; Fri, 19 Aug 2016 06:59:44 +0000 (UTC) Date: Fri, 19 Aug 2016 08:59:44 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Add x | 0 -> x pattern Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 For some reason it was missing. Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. Richard. 2016-08-19 Richard Biener * match.pd (x | 0 -> x): Add. Index: gcc/match.pd =================================================================== --- gcc/match.pd (revision 239570) +++ gcc/match.pd (working copy) @@ -541,13 +541,18 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* x | ~0 -> ~0 */ (simplify - (bit_ior @0 integer_all_onesp@1) - @1) + (bit_ior @0 integer_all_onesp@1) + @1) + +/* x | 0 -> x */ +(simplify + (bit_ior @0 integer_zerop) + @0) /* x & 0 -> 0 */ (simplify - (bit_and @0 integer_zerop@1) - @1) + (bit_and @0 integer_zerop@1) + @1) /* ~x | x -> -1 */ /* ~x ^ x -> -1 */