From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30818 invoked by alias); 6 Apr 2017 12:50:43 -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 30806 invoked by uid 89); 6 Apr 2017 12:50:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=U*ro, biotechnology X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Apr 2017 12:50:39 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 6B05AD89; Thu, 6 Apr 2017 14:50:38 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TqqI887y2Jsg; Thu, 6 Apr 2017 14:50:28 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5DCE13B4.dip0.t-ipconnect.de [93.206.19.180]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 58897D86; Thu, 6 Apr 2017 14:50:28 +0200 (CEST) From: Rainer Orth To: Jeff Law Cc: Jakub Jelinek , Uros Bizjak , 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) References: <20170401122027.GT17461@tucnak> <8eff0bf0-9c78-bf5c-24b9-cba6c3a3b6e7@redhat.com> Date: Thu, 06 Apr 2017 12:50:00 -0000 In-Reply-To: <8eff0bf0-9c78-bf5c-24b9-cba6c3a3b6e7@redhat.com> (Jeff Law's message of "Tue, 4 Apr 2017 11:31:14 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00284.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 2891 Jeff Law writes: > On 04/01/2017 06:20 AM, Jakub Jelinek wrote: >> Hi! >> >> 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? >> >> 2017-04-01 Jakub Jelinek >> >> PR tree-optimization/79390 >> * target.h (struct noce_if_info): Declare. >> * targhooks.h (default_noce_conversion_profitable_p): Declare. >> * target.def (noce_conversion_profitable_p): New target hook. >> * ifcvt.h (struct noce_if_info): New type, moved from ... >> * ifcvt.c (struct noce_if_info): ... here. >> (noce_conversion_profitable_p): Renamed to ... >> (default_noce_conversion_profitable_p): ... this. No longer >> static nor inline. >> (noce_try_store_flag_constants, noce_try_addcc, >> noce_try_store_flag_mask, noce_try_cmove, noce_try_cmove_arith, >> noce_convert_multiple_sets): Use targetm.noce_conversion_profitable_p >> instead of noce_conversion_profitable_p. >> * config/i386/i386.c: Include ifcvt.h. >> (ix86_option_override_internal): Don't override >> PARAM_MAX_RTL_IF_CONVERSION_INSNS default. >> (ix86_noce_conversion_profitable_p): New function. >> (TARGET_NOCE_CONVERSION_PROFITABLE_P): Redefine. >> * config/i386/x86-tune.def (X86_TUNE_ONE_IF_CONV_INSN): Adjust comment. >> * doc/tm.texi.in (TARGET_NOCE_CONVERSION_PROFITABLE_P): Add. >> * doc/tm.texi: Regenerated. >> >> * gcc.target/i386/pr79390.c: New test. >> * gcc.dg/ifcvt-4.c: Use -mtune-ctrl=^one_if_conv_insn for i?86/x86_64. > OK. the new test FAILs on Solaris/x86 with /bin/as: FAIL: gcc.target/i386/pr79390.c scan-assembler [ \\\\t]cmov[a-z]+[ \\\\t] That's because gcc emits cmovl.a %edx, %eax instead of cmova %edx, %eax Fixed as follows, tested with the appropriate runtest invocations on i386-pc-solaris2.12 and x86_64-pc-linux-gnu. I guess this is obvious? Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2017-04-06 Rainer Orth * gcc.target/i386/pr79390.c: Allow for cmovl.a. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=testsuite-i386-pr79390.patch Content-length: 492 # HG changeset patch # Parent 7c92d635959dcb1a757b301344d8519dde9e1e7a Fix gcc.target/i386/pr79390.c for Solaris as diff --git a/gcc/testsuite/gcc.target/i386/pr79390.c b/gcc/testsuite/gcc.target/i386/pr79390.c --- a/gcc/testsuite/gcc.target/i386/pr79390.c +++ b/gcc/testsuite/gcc.target/i386/pr79390.c @@ -25,4 +25,4 @@ foo (void) return jp; } -/* { dg-final { scan-assembler "\[ \\t\]cmov\[a-z]+\[ \\t\]" } } */ +/* { dg-final { scan-assembler "\[ \\t\]cmov\[a-z.]+\[ \\t\]" } } */ --=-=-=--