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: 1859951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=h+16TApd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SP7465XP1z1yQ9 for ; Mon, 6 Nov 2023 21:33:42 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3327E385B52A for ; Mon, 6 Nov 2023 10:33:40 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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); +} +