[{"id":3685539,"web_url":"http://patchwork.ozlabs.org/comment/3685539/","msgid":"<DI9Q1W3I51QT.AZV3N1CWZ3VX@gmail.com>","list_archive_url":null,"date":"2026-05-04T07:42:18","subject":"Re: [PATCH v3] RISC-V: Apply LMUL cost scaling to vector operations","submitter":{"id":86205,"url":"http://patchwork.ozlabs.org/api/people/86205/","name":"Robin Dapp","email":"rdapp.gcc@gmail.com"},"content":"> This patch introduces multiplicative cost scaling (x2/x4/x8) to model\n> the higher latency and register pressure of larger LMULs.  The scaling\n> is applied uniformly in adjust_stmt_cost for all vector operations.\n>\n> In addition to VLA, VLS should also get the same LMUL cost scaling,\n> but doing so causes too many testsuite regressions currently,\n> mostly because these tests also need expectation updates.\n> This is left for future work.\n\nLGTM but the CI (via https://patchwork.sourceware.org/project/gcc/list/?q=risc-v)\nstill flags two failures:\n\nhttps://github.com/ewlu/gcc-precommit-ci/issues/4509#issuecomment-4368190788\n\nXPASS: gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c scan-assembler-not e64,m2\n\nand\n\nFAIL: gcc.target/riscv/rvv/autovec/partial/slp_run-17.c -ftree-vectorize -O3 \n-mrvv-max-lmul=m4 execution test\n\nThe latter is surely pre existing and not caused by your patch.  It would be \ngood to have a short look what's going wrong there and perhaps open a PR once \nyou commit this (with the XPASS fixed).","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Ul0a60zl;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Ul0a60zl","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=none smtp.remote-ip=2a00:1450:4864:20::32a"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8DC12Fhsz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 17:42:52 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 03E134BAE7D7\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 07:42:50 +0000 (GMT)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n [IPv6:2a00:1450:4864:20::32a])\n by sourceware.org (Postfix) with ESMTPS id E6AA24BAD178\n for <gcc-patches@gcc.gnu.org>; Mon,  4 May 2026 07:42:21 +0000 (GMT)","by mail-wm1-x32a.google.com with SMTP id\n 5b1f17b1804b1-4891e86fabeso46769195e9.1\n for <gcc-patches@gcc.gnu.org>; Mon, 04 May 2026 00:42:21 -0700 (PDT)","from localhost (ip-085-216-098-084.um25.pools.vodafone-ip.de.\n [85.216.98.84]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48a8fee4ee7sm72566075e9.17.2026.05.04.00.42.19\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 04 May 2026 00:42:19 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 03E134BAE7D7","OpenDKIM Filter v2.11.0 sourceware.org E6AA24BAD178"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org E6AA24BAD178","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org E6AA24BAD178","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777880542; cv=none;\n b=ppVtNm1xdUuGyypHsIid223IclFBOfG9A5nX5O+Dc98re0nEasz+xuOxwZjpAuH0l/wxPn/p+ahNk2gnriwODIcL6HtJQzOF51Hr9LP/8hwPHZNycu2KQiNF/dyJzR4vS30PrS2LskCW0Rszr84/iq6YQKE4airTzFcnyNeMk28=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777880542; c=relaxed/simple;\n bh=xqenwJnTNIxkhe0CbvchohaEGfk2YCxMY7DrQEzsCb4=;\n h=DKIM-Signature:Mime-Version:Date:Message-Id:To:From:Subject;\n b=DTwB76IFuA7mJhSSNUJjJy69DKppd3RbMAGB1BFMorc6t9K3wWlDfItl5/+s7m8nFOwz7KQ4d3EscHXXS80Gd4tcnjKy00HQtFvv9JS4RG2kpHaGum14tM57zZIdxPsBsMUctrqHGSm3Hrznb+XG8rcszmTmcvX4amdIg7M1pkU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777880541; x=1778485341; darn=gcc.gnu.org;\n h=in-reply-to:references:cc:subject:from:to:message-id:date\n :content-transfer-encoding:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=rMM9MQ2oN6IcqF/VEiekRxwtOJKkm0qa1fc3nNO7oPY=;\n b=Ul0a60zl+Rtu+Ly0PJc1wIdTsHJPXcZB6fjdD2Jeix2CYoYOohZebqRZivIpuFoX6k\n vKLAQHd2HDWcHJQUKIqr4s5SbPrciFcd1P8gwnokkqrRc8RbpdWw7Nvg8gSQ4ZX9gRc9\n dvhxCL+BFYiXhCqZl2Sz9jbspf+eqdCQovAzgUEt40ijgEAO5LBd9SjoQ9FMuq0f1ylf\n Flajcxb0rUmv9QEANlITc/SRwogFWIlxsf5WFOPH7fwW+/17ivFdnlcf+oQgujJbC/yc\n Tu3qoMLM4WFdIn5+Emf2wkP1t9Hlt8Xb1P8Gk+Dh1ovYRhhkoLsbBp5LRnmI0bnowGcT\n gNWg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777880541; x=1778485341;\n h=in-reply-to:references:cc:subject:from:to:message-id:date\n :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state\n :from:to:cc:subject:date:message-id:reply-to;\n bh=rMM9MQ2oN6IcqF/VEiekRxwtOJKkm0qa1fc3nNO7oPY=;\n b=dh6BhlzJn5kWbNDQb4Nyh4jraOva1GaQaVnSJfRmM12YmFGQfEE3q3/xoR3UX8oxO0\n +NfBzjCNoxZzvvu6wysTDmq1WCRZWO2Xescf8ghU7ALcgHQJcFssZ9mV/YLQmKlOMKB0\n jeB5WXU1WAPRM2MfqkoWnf4aZq+gszLd4EP20nXeCOlC3i1wOEuXcrBpCYhoI7Nmvdc2\n wUjPDK4TVZUaufGG4QSDJ3DzF5D3I30RrRq4Fmc6lgP5uWeA2wlHiOrmih5xniXKUcea\n +pQQ1YsNmwePPv+HAjS9Y2zSR8DDLQOtEWLr6qhH6VQAmQYr/ebdwtkZdsfP856VITOL\n aGvA==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8eMsPnb9zPw9xN/045G/4TWiksknWXs2XQo/HA8LRujVpqn3RKBFPEkuzoeVuP9UmY9ylQWYDo45lhbQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YzQUKnb5cbARx0gVmlU6tRNHyLY+ZjH3eZ2wb2bIqIRssqaM6n4\n awxLPoVWqIEv2RjiHNaISXmYsMXIlM4Da3Hyht/UbxmRCP3TgVzxgV4L","X-Gm-Gg":"AeBDiesxGQPWqVbYHdLSUIEEuS+j880yR2pKHpVCRCkfyxISqv+FDR96zVGpBLPddZZ\n U+BsdIUTcp8XOULYMR5kwbx2vnhYtk1u+sVFIip9z103opRbtJgGORQz4fE60jn1nEkOYhPHQWo\n uxlnkZ80lh5mRE8ws/Zidv8EIcr+eVE7xcOMc+iKIL0bjZZuSGWEaWw+wKwTIgI7wyeHt+eEvfw\n zKgZJ0BSA7/DlWkVLDJ72bFtEwRKckCYyRLirCO8FAGyymIbXAbBk4U6wLigo2k7SytB3FRcl02\n ZYwy7svt5RoQBdQPkx0qOUZDNLhJP48Z/oK4ngnKZHPh/yBzZ7Pu+L7aP0++OiQnXLRZUp+sISI\n wOD6/i3/VFugQdz3AZ5RxJxy8GTuD5kMdsKI4UeQfYnz1tLp+vCMtfhCHTPgANwYkpbBsGyCCsg\n qU6VoFyfP+LTUFlsSmGdHexafRaxfLp9kJjywOpaU0/zHiIEWxkiuKC385k0/ueTD9nxDOMvxvm\n JoqOXQ=","X-Received":"by 2002:a05:600c:c170:b0:48a:80cb:1bb4 with SMTP id\n 5b1f17b1804b1-48a98671d52mr134772215e9.22.1777880540574;\n Mon, 04 May 2026 00:42:20 -0700 (PDT)","Mime-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=UTF-8","Date":"Mon, 04 May 2026 09:42:18 +0200","Message-Id":"<DI9Q1W3I51QT.AZV3N1CWZ3VX@gmail.com>","To":"\"Zhongyao Chen\" <chenzhongyao.hit@gmail.com>, <gcc-patches@gcc.gnu.org>","From":"\"Robin Dapp\" <rdapp.gcc@gmail.com>","Subject":"Re: [PATCH v3] RISC-V: Apply LMUL cost scaling to vector operations","Cc":"<rdapp.gcc@gmail.com>, <jeffreyalaw@gmail.com>, <chen.zhongyao@zte.com.cn>","References":"<20260504034510.3574-1-chen.zhongyao@zte.com.cn>","In-Reply-To":"<20260504034510.3574-1-chen.zhongyao@zte.com.cn>","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}}]