From patchwork Wed Oct 18 01:20:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 154609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4499275vqb; Tue, 17 Oct 2023 18:21:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgpyC5NfplzZnzODZieF3Oo9ivbIQuAFpm1dIg/Vp0ZCzM6TNCkGpUeHjhvPtv0XeauPJ3 X-Received: by 2002:a05:620a:3728:b0:76d:4252:95d2 with SMTP id de40-20020a05620a372800b0076d425295d2mr4465198qkb.39.1697592067909; Tue, 17 Oct 2023 18:21:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697592067; cv=pass; d=google.com; s=arc-20160816; b=aKvOKo9hcFoeiLKtgFZG/cNW6UqMefinoj25EsPF+81apJ1nfY9AutxeN70KkNd6iQ YYeFS7hojlhkOeiPyp4FvLaeP7Ap8WMN3I+isn7KydQlp+wgloB0YvQ01xQUPRNdvLKR k/AK4CpvEa9ULCJkOANeN8jvtwFMyj7WzEkoEDaI4NcBcrH82Z83FvFwHf701EDMZPsV dpyybmQLmDAhapWWk1HgVn1k0z7GmoGQLMAZD5+7a3A8Gb4cx7jTLWaEujpPTdinL7s0 ojgprw4udXNVtEz/48MMxKSEI5gy4ATwIPbU+DDZJh724MLrdLe1b9/WuIPWSvov4Ltz bafQ== 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=4/oUaNYhX1+A1Fbw9xjb7KNp0p5maexWj5tIh2uD3fc=; fh=ZhoqF74dgOqAZwaTs8Qqd9D4B/xVeIfaG9dzbeNwyjI=; b=oMsPNbv22pRusZnrbWwcRMHkspOo8MHxFvg8WfvsLvb5j7a2DUMAT/67+XNekNdBzw TqWX6HRLImiqXLBTl6DJbu6vqsSA8L5JQGuPH+QsSGQAXL6mAb1sApHc/ZN0Gd4AsPUA 3DbNu0hIJ843abCEb1FyOiCxTSvkAfPCrMlK1Oi+wH7flwEpSNAPRAFhVGb2MXVsCzNJ OBTLA7FWXBUD4L7LvBDB2tJIbSfj8yaF6LR3xsUDNxz0FOJF0nwmqVoFz5JxtpU7txza YfteSqYibJPcwV+8M6FpGWkFrmudqG8uGdHIo3poT+5WlroRPnNpDJrXqv0O0tiACV2C dVbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nOUUOFXY; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id vu11-20020a05620a560b00b0076830225684si1886175qkn.544.2023.10.17.18.21.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 18:21:07 -0700 (PDT) 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=nOUUOFXY; 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 A4AE33858298 for ; Wed, 18 Oct 2023 01:21:07 +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.88]) by sourceware.org (Postfix) with ESMTPS id 7A4333858C52 for ; Wed, 18 Oct 2023 01:20:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A4333858C52 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 7A4333858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.55.52.88 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697592017; cv=none; b=NMHGzJ1xvQA9ofHjmJ0A1H9llu59+Zup4lwDvC7tUQ7XLP0QjmeFVSGIHItvCuw8FyMYnHsywPvhNRoh3oIq+WuyF63Pqs23yKNy29x2EZImVbRE34LXfBuvt03DBt4OxcY+66lUc2JAmCYSHqkJtvNjQy52vnj/mJDEXlz0tJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697592017; c=relaxed/simple; bh=HQvBZISZpKNpEvtqwAyIdQGp5dNukQx2W0MnfrtMOi0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=QsHy7khUsxm/VN1zN9rHOcifHxFgfw6XKBGc6O9O+VSCke7f9+Ksy9E3IPOXc6dhqidNfQXYTttGZnGPE357gxcM8rHvIhSQMlO8crMGGzfftAY/NXkiLACKp/61iYZ3ZmnPUlR6V+BMz36ZxqzikjMb6oRuBXiGnmWfdDAQOq8= 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=1697592015; x=1729128015; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HQvBZISZpKNpEvtqwAyIdQGp5dNukQx2W0MnfrtMOi0=; b=nOUUOFXYwKY1a8yTSaqSG7L7Pe4hxBO2wfv9wrHZ2VqpwV0RsskNlqsQ 8vmtUXATFDTdr1IkymhMHPgZAp7nAo/wjiksrARjj5liO9XJmX36bGFKU h/JnxYCa2/nxI4evO+enLkhQECOiWPs8mZ6nADKDvA1uut3El05qdIRfg dcQ+Jjbi0EJg3YPNiXu2zRa3c/m45lVy44Fsy7y2hDH9n6GZ1TKuZNACf 7FthA98p6twuFviRygRnfh/rmdxftbQL+ZsXvBQbKqY2J3nZ0UAzgqpud UD9Nf13yNHHjnum02cTOt2JfEWa0Ejssbepd/AAJinLoWhxQ6hGVdkWhT w==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="417022415" X-IronPort-AV: E=Sophos;i="6.03,233,1694761200"; d="scan'208";a="417022415" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 18:20:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="760028077" X-IronPort-AV: E=Sophos;i="6.03,233,1694761200"; d="scan'208";a="760028077" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by fmsmga007.fm.intel.com with ESMTP; 17 Oct 2023 18:20:11 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id C8A5B10056A4; Wed, 18 Oct 2023 09:20:10 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com, hongtao.liu@intel.com, richard.guenther@gmail.com Subject: [PATCH v1] RISC-V: Remove the type size restriction of vectorizer Date: Wed, 18 Oct 2023 09:20:09 +0800 Message-Id: <20231018012009.849697-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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: 1780054300369914314 X-GMAIL-MSGID: 1780054300369914314 From: Pan Li The vectoriable_call has one restriction of the size of data type. Aka DF to DI is allowed but SF to DI isn't. You may see below message when try to vectorize function call like lrintf. void test_lrintf (long *out, float *in, unsigned count) { for (unsigned i = 0; i < count; i++) out[i] = __builtin_lrintf (in[i]); } lrintf.c:5:26: missed: couldn't vectorize loop lrintf.c:5:26: missed: not vectorized: unsupported data-type Then the standard name pattern like lrintmn2 cannot work for different data type size like SF => DI. This patch would like to remove this data type size check and unblock the standard name like lrintmn2. Passed the x86 bootstrap and regression test already. gcc/ChangeLog: * tree-vect-stmts.cc (vectorizable_call): Remove data size check. Signed-off-by: Pan Li --- gcc/tree-vect-stmts.cc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index b3a56498595..326e000a71d 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -3529,19 +3529,6 @@ vectorizable_call (vec_info *vinfo, return false; } - /* FORNOW: we don't yet support mixtures of vector sizes for calls, - just mixtures of nunits. E.g. DI->SI versions of __builtin_ctz* - are traditionally vectorized as two VnDI->VnDI IFN_CTZs followed - by a pack of the two vectors into an SI vector. We would need - separate code to handle direct VnDI->VnSI IFN_CTZs. */ - if (TYPE_SIZE (vectype_in) != TYPE_SIZE (vectype_out)) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "mismatched vector sizes %T and %T\n", - vectype_in, vectype_out); - return false; - } if (VECTOR_BOOLEAN_TYPE_P (vectype_out) != VECTOR_BOOLEAN_TYPE_P (vectype_in))