From patchwork Thu Nov 16 06:17:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiahao Xu X-Patchwork-Id: 165702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3016369vqg; Wed, 15 Nov 2023 22:17:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTSZV40tN5aFATNX8TInjMbAqUv4nus1KVEGrDTxTuWe9/mCzFq1dkpVup+YWlvlxEiC1z X-Received: by 2002:a05:622a:1792:b0:40f:ce6d:775e with SMTP id s18-20020a05622a179200b0040fce6d775emr8764429qtk.42.1700115467779; Wed, 15 Nov 2023 22:17:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700115467; cv=pass; d=google.com; s=arc-20160816; b=i8zS3FxL5pzDgPeGulAfpCCaRJfT3yBUTkYDTPekn6IWZjhMqnLfp6bbVImzzP8/L7 TP54LX6SEZIW76KA6bN2l9Ft+nsIlHEyMzFbTDLoJkrqBcEIDV5vFzyHcD69zw68rNLg wYb59TvfxOEhFQ0QzWMFnuo+QTSR3ySWHR1hMY5uLS/qVFmSbECoLgGzIZdsC3fsApTY Bah5Wv9C8Vu+R98zBHMukE3JODRuELoykdMHxNiucRIQX+CiuPYIEHIfBPRsBfCS3w0s 8ZKSOQJokdibcChF7B3LwjSgYsV4lddE+kCjP6vy0XHRo3h1rIBZEdiYJEmmNwxQyJOe sNgQ== 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:arc-filter :dmarc-filter:delivered-to; bh=4vA/hiRv5mISb4MRDzIOnDv56IPj+S/cd/vTs9j42Ak=; fh=w+xsGLuzpTj56E0bzPMCc39RWHkBXt2f2AGs+4pGimo=; b=myt67dIErfrswx7EGXw1V4kLHMa+clO/iciREtLgTKEXo3js0OIuISfeTvpU2XiFyo Boq0csi7lE+Iz2SXKjS8H9m7m3kVbvd9xSdX6l0xxbTtQd0r1C6VybhKx1NKM8Rwjude huG73zCaw6pSJbjE8CxiqSJ83y+jz/MnPtmPcB3b2ibPUYU6iH0a53CDQcn/ftDi3DNW sBx2gUcvsOYovC4JL2a4Y8UqUEAeXLx0FmPsLGD5DIui3ZdegPb4BmBUCO0HOPPas2vG KbRLUSzowKF9cF8KnE8SNOTETNHzbUZwVgku/Q1DsyozJeX5lDzzE9LfQqYoCvqQUCju YMSQ== ARC-Authentication-Results: i=2; mx.google.com; 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" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w14-20020a05622a190e00b004181590e39fsi10093941qtc.807.2023.11.15.22.17.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 22:17:47 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E05E38582AA for ; Thu, 16 Nov 2023 06:17:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 6FEF63858402 for ; Thu, 16 Nov 2023 06:17:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FEF63858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6FEF63858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700115445; cv=none; b=TV0NYrtvpLbs7C5ZspV1rNJ1liP8IjJfCMGFb0gvNZsXKlwVvbMnatAhW9TktJJTzik7Vtc170WCmK8jkthFV+MCXkPUVswVAdbjFY3ipkgwi39gmKiMUoc36NA5lZU1dlcLNZruHTQsG+8VNhwzZkR/neavvTZToOmIUEoBc1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700115445; c=relaxed/simple; bh=auRcNaF19mDGkQ31FsFd1HX2d8L2P+WJNYLQU7ba4Hk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=rRp0TVFf92cz42o0fmvdiOisNWQ+ZJVf/FyAzoM7I04YlNCTn98Rz3xMTdnj3zL+8AJo6/HYIF3IQccEsVQVaqtx1Pq3A4eNSxacX9rZJF27L/TM6zTZZ0oQ2dk05U9IJRO/bRX5eRw8Jn85KJuBfMAtj3oAxAyMEfv+SUOK4jk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8DxPOvqs1Vl7Xg6AA--.44033S3; Thu, 16 Nov 2023 14:17:15 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx7tzos1VlRNFDAA--.18277S4; Thu, 16 Nov 2023 14:17:12 +0800 (CST) From: Jiahao Xu To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, chenglulu@loongson.cn, xuchenghua@loongson.cn, Jiahao Xu Subject: [PATCH] LoongArch: Increase cost of vector aligned store/load. Date: Thu, 16 Nov 2023 14:17:09 +0800 Message-Id: <20231116061709.9897-1-xujiahao@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bx7tzos1VlRNFDAA--.18277S4 X-CM-SenderInfo: 50xmxthkdrqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj9xXoWrKF4ktryxXw1xAF15Zr1fGrX_yoWkGwb_Xw nrGa4qgr4UtayYyr4qqr98G3y5Xa18tF98CF9Iqr4xGrW8Xws8Aw1DAwnxZw18KryfW3Zx tF4Fkryayr1a9osvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1EksDUUUUU== X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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: 1782700276503368866 X-GMAIL-MSGID: 1782700276503368866 Based on SPEC2017 performance evaluation results, making them equal to the cost of unaligned store/load to avoid odd alignment peeling is better. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_builtin_vectorization_cost): Adjust. diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 738911661d7..d05743bec87 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -3893,11 +3893,9 @@ loongarch_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, case scalar_stmt: case scalar_load: case vector_stmt: - case vector_load: case vec_to_scalar: case scalar_to_vec: case scalar_store: - case vector_store: return 1; case vec_promote_demote: @@ -3905,6 +3903,8 @@ loongarch_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, return LASX_SUPPORTED_MODE_P (mode) && !LSX_SUPPORTED_MODE_P (mode) ? 2 : 1; + case vector_load: + case vector_store: case unaligned_load: case unaligned_store: return 2;