From patchwork Fri Mar 3 19:44:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 735222 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 3vZflY3FjBz9s03 for ; Sat, 4 Mar 2017 06:44:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LYCTUJNq"; 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:cc:subject:message-id:reply-to:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=Yo2QYoIuYAKp38gEj G7qB/qp5ISfr0v3XeM7kPHFYpLv8dmK1DCfAT+LmUCQh3M9imshWML1zVAsz4dfc 3K1VPNHwecnkpdlrghUjwyNa2WfLABrIOn/tI+KakKKy5zxLIBUMMy16mEaISDSE wcUfZMLIztnb56fZlp8PgppBTk= 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:cc:subject:message-id:reply-to:references:mime-version :content-type:in-reply-to; s=default; bh=eTHcWTAFE4ZByAipspAF+y1 2J1U=; b=LYCTUJNq//BqLVgugW8xIz0GLLtKJgvGO+dmnqmWUxi9j4ksChsSJ9q MupmJaFXChbfwBHha9jUERFkNb3NFbA1JvVl55zhSWR+WGaVYY+OihKx8steP8nK ta/NpVN4uZR+BK1l3wDu2vatxBmiPkv/L16bKn+f1a62wWheXVMs= Received: (qmail 111802 invoked by alias); 3 Mar 2017 19:44:28 -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 111746 invoked by uid 89); 3 Mar 2017 19:44:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, MEDICAL_SUBJECT, 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; Fri, 03 Mar 2017 19:44:25 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7833361BA0; Fri, 3 Mar 2017 19:44:25 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-76.ams2.redhat.com [10.36.117.76]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23JiNAA005440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Mar 2017 14:44:25 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v23JiLjC006512; Fri, 3 Mar 2017 20:44:21 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v23JiL1F006511; Fri, 3 Mar 2017 20:44:21 +0100 Date: Fri, 3 Mar 2017 20:44:20 +0100 From: Jakub Jelinek To: Uros Bizjak Cc: "gcc-patches@gcc.gnu.org" Subject: [PATCH] Add " && !(MEM_P (operands[0]) && MEM_P (operands[1]))" to condition of some sse.md instructions Message-ID: <20170303194420.GH1849@tucnak> Reply-To: Jakub Jelinek References: <20170302214419.GT1849@tucnak> <20170303103530.GW1849@tucnak> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes On Fri, Mar 03, 2017 at 12:18:09PM +0100, Uros Bizjak wrote: > Yes. Although expander takes care not to generate two memory > references, combine can propagate memory to the other operand, > creating semi-invalid RTX that is later resolved by RA. Here is a patch which does that. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-03-03 Jakub Jelinek * config/i386/sse.md (sse_storehps, sse_storelps, avx__, avx512f__, avx512f__256): Require in condition that at least one operand is not a MEM. Jakub --- gcc/config/i386/sse.md.jj 2017-03-03 17:08:53.000000000 +0100 +++ gcc/config/i386/sse.md 2017-03-03 17:39:05.907871328 +0100 @@ -6637,7 +6637,7 @@ (define_insn "sse_storehps" (vec_select:V2SF (match_operand:V4SF 1 "nonimmediate_operand" "v,v,o") (parallel [(const_int 2) (const_int 3)])))] - "TARGET_SSE" + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ %vmovhps\t{%1, %0|%q0, %1} %vmovhlps\t{%1, %d0|%d0, %1} @@ -6690,7 +6690,7 @@ (define_insn "sse_storelps" (vec_select:V2SF (match_operand:V4SF 1 "nonimmediate_operand" " v,v,m") (parallel [(const_int 0) (const_int 1)])))] - "TARGET_SSE" + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ %vmovlps\t{%1, %0|%q0, %1} %vmovaps\t{%1, %0|%0, %1} @@ -18661,7 +18661,7 @@ (define_insn_and_split "avx_ 1 "nonimmediate_operand" "xm,x")] UNSPEC_CAST))] - "TARGET_AVX" + "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "#" "&& reload_completed" [(set (match_dup 0) (match_dup 1))] @@ -19575,7 +19575,7 @@ (define_insn_and_split "avx512f_ 1 "nonimmediate_operand" "xm,x")] UNSPEC_CAST))] - "TARGET_AVX512F" + "TARGET_AVX512F && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "#" "&& reload_completed" [(set (match_dup 0) (match_dup 1))] @@ -19592,7 +19592,7 @@ (define_insn_and_split "avx512f_ 1 "nonimmediate_operand" "xm,x")] UNSPEC_CAST))] - "TARGET_AVX512F" + "TARGET_AVX512F && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "#" "&& reload_completed" [(set (match_dup 0) (match_dup 1))]