From patchwork Sat Sep 18 03:09:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 1529587 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=FEsOOAao; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HBG5k6KBnz9sW4 for ; Sat, 18 Sep 2021 13:10:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21F49385AC1B for ; Sat, 18 Sep 2021 03:09:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21F49385AC1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631934598; bh=sgJdN6n/rSgt8AaxZtce5PJPQ0fNHpkQZkaDkSIAd7Y=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=FEsOOAaoV5wSc39gD0HzfnXgn589j9BQyP3btqrFr/vGKdyd9ulwp4x+U1/3P8Mi8 muPLyO0a7gWP1Blr8ZWLbQow+7/fI+WRSokZcgyLioQXqbARIeJBFMsSoa2glyjrLQ I/388t4C9XgNVRYfTFaD59iXViG/7SotWKD6JPMo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id 19A333858D34 for ; Sat, 18 Sep 2021 03:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 19A333858D34 X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="245307485" X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="245307485" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2021 20:09:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="472509373" Received: from scymds01.sc.intel.com ([10.148.94.138]) by fmsmga007.fm.intel.com with ESMTP; 17 Sep 2021 20:09:34 -0700 Received: from shliclel219.sh.intel.com (shliclel219.sh.intel.com [10.239.236.219]) by scymds01.sc.intel.com with ESMTP id 18I39Wdv030982; Fri, 17 Sep 2021 20:09:33 -0700 To: gcc-patches@gcc.gnu.org Subject: [PATCH] [i386] Fix ICE in pass_rpad. Date: Sat, 18 Sep 2021 11:09:32 +0800 Message-Id: <20210918030932.2907679-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: liuhongt via Gcc-patches From: liuhongt Reply-To: liuhongt Cc: jakub@redhat.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Besides conversion instructions, pass_rpad also handles scalar sqrt/rsqrt/rcp/round instructions, while r12-3614 should only want to handle conversion instructions, so fix it. Bootstrapped and regtest on x86_64-linux-gnu{-m32,} w/ configure --enable-checking=yes,rtl,extra, failed tests are fixed. Ok for trunk? New tests that PASS (8 tests): gcc.target/i386/avx512f-vscalefpd-2.c execution test gcc.target/i386/avx512f-vscalefps-2.c execution test gcc.target/i386/avx512f-vscalefss-2.c execution test gcc.target/i386/avx512fp16-vscalefph-1b.c execution test gcc.target/i386/avx512fp16-vscalefsh-1b.c execution test gcc.target/i386/avx512fp16vl-vscalefph-1b.c execution test gcc.target/i386/avx512vl-vscalefpd-2.c execution test gcc.target/i386/avx512vl-vscalefps-2.c execution test Old tests that failed, that have disappeared (8 tests): (Eeek!) gcc.target/i386/avx512f-vscalefpd-2.c (internal compiler error) gcc.target/i386/avx512f-vscalefps-2.c (internal compiler error) gcc.target/i386/avx512f-vscalefss-2.c (internal compiler error) gcc.target/i386/avx512fp16-vscalefph-1b.c (internal compiler error) gcc.target/i386/avx512fp16-vscalefsh-1b.c (internal compiler error) gcc.target/i386/avx512fp16vl-vscalefph-1b.c (internal compiler error) gcc.target/i386/avx512vl-vscalefpd-2.c (internal compiler error) gcc.target/i386/avx512vl-vscalefps-2.c (internal compiler error) gcc/ChangeLog: * config/i386/i386-features.c (remove_partial_avx_dependency): Restrict TARGET_USE_VECTOR_FP_CONVERTS and TARGET_USE_VECTOR_CONVERTS to conversion instructions only. --- gcc/config/i386/i386-features.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c index a525a83afd3..001dc9c1053 100644 --- a/gcc/config/i386/i386-features.c +++ b/gcc/config/i386/i386-features.c @@ -2165,7 +2165,7 @@ make_pass_insert_endbr_and_patchable_area (gcc::context *ctxt) } /* At entry of the nearest common dominator for basic blocks with - conversions, generate a single + conversions/rcp/sqrt/rsqrt/round, generate a single vxorps %xmmN, %xmmN, %xmmN for all vcvtss2sd op, %xmmN, %xmmX @@ -2211,13 +2211,27 @@ remove_partial_avx_dependency (void) continue; /* Convert PARTIAL_XMM_UPDATE_TRUE insns, DF -> SF, SF -> DF, - SI -> SF, SI -> DF, DI -> SF, DI -> DF, to vec_dup and - vec_merge with subreg. */ + SI -> SF, SI -> DF, DI -> SF, DI -> DF, sqrt, rsqrt, rcp, + round, to vec_dup and vec_merge with subreg. */ rtx src = SET_SRC (set); rtx dest = SET_DEST (set); machine_mode dest_mode = GET_MODE (dest); - machine_mode src_mode = GET_MODE (XEXP (src, 0)); + bool convert_p = false; + switch (GET_CODE (src)) + { + case FLOAT: + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + case UNSIGNED_FLOAT: + convert_p = true; + break; + default: + break; + } + /* Only hanlde conversion here. */ + machine_mode src_mode + = convert_p ? GET_MODE (XEXP (src, 0)) : VOIDmode; switch (src_mode) { case E_SFmode: @@ -2233,6 +2247,7 @@ remove_partial_avx_dependency (void) continue; break; default: + gcc_assert (src_mode == E_VOIDmode); break; }