From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1910 invoked by alias); 1 Apr 2017 18:47:37 -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 1890 invoked by uid 89); 1 Apr 2017 18:47:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 18:47:36 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFDD185376; Sat, 1 Apr 2017 18:47:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BFDD185376 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BFDD185376 Received: from tucnak.zalov.cz (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 60C4360319; Sat, 1 Apr 2017 18:47:35 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v31IlWLq021496; Sat, 1 Apr 2017 20:47:33 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v31IlTnw017067; Sat, 1 Apr 2017 20:47:29 +0200 Date: Sat, 01 Apr 2017 18:47:00 -0000 From: Jakub Jelinek To: Segher Boessenkool Cc: Uros Bizjak , Jeff Law , Bernd Schmidt , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] On x86 allow if-conversion of more than one insn as long as there is at most one cmov (PR tree-optimization/79390) Message-ID: <20170401184729.GX17461@tucnak> Reply-To: Jakub Jelinek References: <20170401122027.GT17461@tucnak> <20170401184335.GE4402@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170401184335.GE4402@gate.crashing.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00024.txt.bz2 On Sat, Apr 01, 2017 at 01:43:36PM -0500, Segher Boessenkool wrote: > Hi, > > On Sat, Apr 01, 2017 at 02:20:27PM +0200, Jakub Jelinek wrote: > > As discussed in the PR, in the following testcase we don't if-convert > > with the generic (and many other) tuning, because we default to > > --param max-rtl-if-conversion-insns=1 in most of the tunings. > > The problem we have is with multiple cmov instructions, but in the > > testcase there is just one cmov and the other insn is turned into a SSE > > max insn, which is fine. > > > > This patch stops artificially lowering that param, and for one_if_conv_insn > > tuning it instead rejects the if-conversion if the resulting sequence has > > multiple cmov instructions. The hook is passed if_info too, so it can > > in the future do better heuristics based on predictability of the edges, > > how far the uses of the cmov result are (I assume cmov major problem is > > latency, right?) etc. > > > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Does this change anything for targets that do not implement the new hook? No. The patch changes all calls to noce_conversion_profitable_p into the new target hook with the same parameters, and provides the old definition of the function as the default implementation of the target hook. So, other targets shouldn't see any change (ok, indirect vs. direct call or inline in the compiler internals), and targets that choose to override it can use the default hook as fallthrough or whatever else they choose. > It isn't immediately obvious from the patch. Jakub