From patchwork Mon Nov 6 10:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 161932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2563920vqu; Mon, 6 Nov 2023 02:33:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtfxMWFXZiGX16ry41j06IzSl8HrzJMxstU3k8oCqKXxMUTquQY4LU39dBi3IkXQxo+Q9i X-Received: by 2002:a05:620a:4489:b0:778:ba13:a69d with SMTP id x9-20020a05620a448900b00778ba13a69dmr13682934qkp.17.1699266833178; Mon, 06 Nov 2023 02:33:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699266833; cv=pass; d=google.com; s=arc-20160816; b=iyj3Zcfq0yCXQq+kD0haLSe9h8mw+Aa/TcnfXyKgkPI6vBLcUJK8DFg6/gOBrAUoxo H+S7ehEXj2X74E8+3wI2gRezKne9+phuLXRgKtjJlIT+b7FL6qElH+nRYQ1EDRVYNMRT jfy4i64GRADSov/u7KvRmcpRyj0+u8DdDSWZ2HqzrPIRNm/qukew9q9oN+t2al20cNsk 2MPobXGca2ig4+QhnwfBfS4C5tV6beAfWORDEXdNS04siObwiUPNUzv8wjGaPZQquuS8 IBoJLfigZRzo+h0VnOrEgi3az9aCHlywWa3arB28Iq1vICi7VuScTjWya1ZjwAqtGIfm Fhpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=nK+4hUEp05lWv0vSt8pKHx7h5ZZ0KoCNFn0QmsFkbxY=; fh=ChXOctppJn0KECDRINafwUY5xHRufGHaa0Ju9pddrcQ=; b=aIpCQ7ZVw495+i2pEiDk54x/hqEH07gxCrOLtnHUY74n4SzLsZjzCBHe7UrB2i8uPa izxzjS4W/TmaxdQe5kE40gDca8/J1sUwECNohOyAi6BoBZJhnUbphiY70dIuqEjOb4F+ MAEfWRaOCl5afuqU2xDlggLk2XecnzbU0mVsVgb6TvhDmso1JgV4XStwnzLlO79qBjHy n+G5WKzJyBStIGjuFEkbyPu2sEbV38f7b2+z38KGBqMXz1ZCHiCmrZiD4pyltGTAyTvi cOt2vyfUTWCKw+IuBojggui6NpdMF6eqsSOKjC/VRO1C14CetWSVYJWf1gPzHr01wRv7 B+Yw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h+16TApd; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h12-20020a05620a13ec00b0076cd007b54fsi5228902qkl.183.2023.11.06.02.33.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 02:33:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h+16TApd; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFF583858288 for ; Mon, 6 Nov 2023 10:33:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id AD6943858D28 for ; Mon, 6 Nov 2023 10:33:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD6943858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD6943858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.55.52.151 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699266809; cv=none; b=fXhjOLZsqM39LQppEFRSSniGZU3ERbXq0ZjzgGogvhaYWFC69iwnLXRlrrc9MC04JAKCXq+2xI4zHjL9Z4PzhcAAVfhV77MlByqNbJ2WFWMnNoQVF6Yx94rJka5P5qvD5EdtEnGaqw1qc+Gf5lWNLQdQicVLqiMkfJrzpON5QZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699266809; c=relaxed/simple; bh=BeIsi93o5Pc0Yc1bIhwbvfHZEc8QFQu86P5lujPbsD0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=MPn4ECYNvqVxc5upXB5w4FKEoL5NqlSU4b+NlUbjPZqGroT7aWCEq4IdSQ9BKxvikQEGcKSvYUxnrc/tcy0LewmkET5zEzVZsPPoqOsgI00EY1IAz8FbBRqAo7DC6JFBzcyoH89j/UR47c8sR501q0laKHytqLO97NpBcsbvaKE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699266798; x=1730802798; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BeIsi93o5Pc0Yc1bIhwbvfHZEc8QFQu86P5lujPbsD0=; b=h+16TApdLqYOwIRAOPu+2q8BkF12aZWCWpuh0KktSGqlhTTG6KzZbNzA ioeOz+90+IVoS++JDkLXTU/KY4Iup908vJ3dh9CWC+RXSGgfXDS6+ojKh OqtzoyBrMiS+4irmCzz88s1ZXxy6R0bHOaocHZBPOz5Y0kptm/HEkR/zU CxFqFORaGsOoOFAMqsCwLYOCs7fA5GVVGj0i7UbEcEiG0tRoWoKsEaCKv FGT1/knW1r4mr+Lj030Ls+Are/b0E3HjnfwQalixv1KR4OALhXAUXm8L8 EjQXuifDuptyLe2T3FU6xJZURxxkolgrXNiMSzD5I36+DZI8GQB5SqW/o A==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="369455011" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="369455011" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 02:33:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="1093745959" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="1093745959" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga005.fm.intel.com with ESMTP; 06 Nov 2023 02:33:08 -0800 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 69B5010056FF; Mon, 6 Nov 2023 18:33:03 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com Subject: [PATCH] Avoid generating RTL code when d->testing_p. Date: Mon, 6 Nov 2023 18:31:03 +0800 Message-Id: <20231106103103.3374589-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781810418857887627 X-GMAIL-MSGID: 1781810418857887627 Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: PR target/112393 * config/i386/i386-expand.cc (ix86_expand_vec_perm_vpermt2): Avoid generating RTL code when d->testing_p. gcc/testsuite/ChangeLog: * gcc.target/i386/pr112393.c: New test. --- gcc/config/i386/i386-expand.cc | 3 +++ gcc/testsuite/gcc.target/i386/pr112393.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr112393.c diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index 6ae5830037d..8fad73c1549 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -5245,6 +5245,9 @@ ix86_expand_vec_perm_vpermt2 (rtx target, rtx mask, rtx op0, rtx op1, if (gen == NULL) return false; + if (d && d->testing_p) + return true; + /* ix86_expand_vec_perm_vpermt2 is called from both const and non-const expander, so args are either in d, or in op0, op1 etc. */ if (d) diff --git a/gcc/testsuite/gcc.target/i386/pr112393.c b/gcc/testsuite/gcc.target/i386/pr112393.c new file mode 100644 index 00000000000..c5c5b95b188 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr112393.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512f -Wuninitialized" } */ +typedef _Float16 __attribute__((__vector_size__ (32))) V; + +V v; + +void +foo (void) +{ + (void) __builtin_shufflevector (v, __builtin_shufflevector (v, (V){}, + 3, 0, 2, 2, + 5, 6, 3, 7, 5, + 6, 0, 8, 6, 4, + 3, 2, 8, 9, 5, + 8, 8, 7, 5, 4, + 8, 9, 1, 2, 4, + 9, 9, 7), + 40, 33); +} +