From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19438 invoked by alias); 5 Dec 2016 10:50:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18825 invoked by uid 89); 5 Dec 2016 10:50:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=sensitive, ciao, ongoing, Hx-languages-length:2769 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Dec 2016 10:49:55 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uB5AnPq9127094 for ; Mon, 5 Dec 2016 05:49:54 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2756h692ae-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 05 Dec 2016 05:49:54 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Dec 2016 10:49:52 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 5 Dec 2016 10:49:50 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 849F717D805F for ; Mon, 5 Dec 2016 10:52:22 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uB5Annd048234510 for ; Mon, 5 Dec 2016 10:49:49 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uB5AnnkY018332 for ; Mon, 5 Dec 2016 03:49:49 -0700 Received: from oc5510024614.ibm.com (sig-9-145-35-226.uk.ibm.com [9.145.35.226]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uB5Anmrh018329; Mon, 5 Dec 2016 03:49:48 -0700 Received: by oc5510024614.ibm.com (Postfix, from userid 500) id A563018F5B; Mon, 5 Dec 2016 11:49:53 +0100 (CET) Date: Mon, 05 Dec 2016 10:50:00 -0000 From: Dominik Vogt To: Segher Boessenkool Cc: Bernd Schmidt , gcc-patches@gcc.gnu.org, Andreas Krebbel , Ulrich Weigand Subject: Re: [PATCH v3] Do not simplify "(and (reg) (const bit))" to if_then_else. Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: vogt@linux.vnet.ibm.com, Segher Boessenkool , Bernd Schmidt , gcc-patches@gcc.gnu.org, Andreas Krebbel , Ulrich Weigand References: <20161031195610.GA3558@linux.vnet.ibm.com> <4c9dd4a4-9f4f-048c-67d5-8ace6bd6eb8c@redhat.com> <20161111111028.GA30873@linux.vnet.ibm.com> <20161121123647.GA22233@linux.vnet.ibm.com> <9044f460-61af-3680-4ac4-5ac9d7ead673@redhat.com> <20161201153008.GA28115@linux.vnet.ibm.com> <20161204011913.GM14873@gate.crashing.org> <20161205092212.GA31328@linux.vnet.ibm.com> <20161205100025.GC2767@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161205100025.GC2767@gate.crashing.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16120510-0040-0000-0000-00000317327A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16120510-0041-0000-0000-00001E1E30C5 Message-Id: <20161205104953.GA31017@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-05_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612050192 X-SW-Source: 2016-12/txt/msg00316.txt.bz2 On Mon, Dec 05, 2016 at 04:00:25AM -0600, Segher Boessenkool wrote: > On Mon, Dec 05, 2016 at 10:22:13AM +0100, Dominik Vogt wrote: > > On Sat, Dec 03, 2016 at 07:19:13PM -0600, Segher Boessenkool wrote: > > > [ I did not see this patch before, sorry. ] > > > > > > This causes the second half of PR78638. > > > > > > On Thu, Dec 01, 2016 at 04:30:08PM +0100, Dominik Vogt wrote: > > > > --- a/gcc/combine.c > > > > +++ b/gcc/combine.c > > > > @@ -5600,6 +5600,18 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest, > > > > && OBJECT_P (SUBREG_REG (XEXP (x, 0))))))) > > > > { > > > > rtx cond, true_rtx, false_rtx; > > > > + unsigned HOST_WIDE_INT nz; > > > > + > > > > + /* If the operation is an AND wrapped in a SIGN_EXTEND or ZERO_EXTEND with > > > > + either operand being just a constant single bit value, do nothing since > > > > + IF_THEN_ELSE is likely to increase the expression's complexity. */ > > > > + if (HWI_COMPUTABLE_MODE_P (mode) > > > > + && pow2p_hwi (nz = nonzero_bits (x, mode)) > > > > + && ! ((code == SIGN_EXTEND || code == ZERO_EXTEND) > > > > + && GET_CODE (XEXP (x, 0)) == AND > > > > + && CONST_INT_P (XEXP (XEXP (x, 0), 0)) > > > > + && UINTVAL (XEXP (XEXP (x, 0), 0)) == nz)) > > > > + return x; > > > > > > The code does not match the comment: the "!" should not be there. How > > > did it fix anything on s390 *with* that "!"? That does not make much > > > sense. > > > > Sorry for breaking this. With the constant changes in the > > patterns this is supposed to fix it seems I've lost track of the > > status quo. I'll check what went wrong with the patch; in the > > mean time Andreas will revert this, or if it's urgent, feel free > > to do that yourself. > > I have tested that removing that ! cures all regressions. I do not > know if it still fixes what this patch intended to fix, of course. S390[x] has these complicated patterns for the risbg instruction, and there's some ongoing work on patterns for related instructions (rosbg, rxsbg) which needed the patch discussed here - at least at some point in time. But the risbg patterns are breaking all over the place because they are so sensitive to changes in combine.c (and possibly other passes), and any change fixing the old patterns may affect the new ones. In other words: At the moment I have no clue whether the discussed patch is still good for anythin on s390[x]. If there was a consensus that the patch discussed here, with the "!" fix is useful in any case, that would simplify my current work, but 1) I've done no testing with it (only with the broken version of the patch), 2) it may be just a chunk of dead code. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany