[{"id":3680308,"web_url":"http://patchwork.ozlabs.org/comment/3680308/","msgid":"<20260422082354.3005477-1-wangzicong@masscore.cn>","list_archive_url":null,"date":"2026-04-22T08:23:54","subject":"Re: [PATCH v2] RISC-V: Make tuple vector not tieable to some modes.","submitter":{"id":93140,"url":"http://patchwork.ozlabs.org/api/people/93140/","name":"wangzicong","email":"wangzicong@masscore.cn"},"content":"I found that there are some failed testcases so had a look. It happens to \nbe the situation we discussed before.\nSo when compiling function f5 in \ngcc.target/riscv/rvv/autovec/struct/struct_vect-1.c, GCC unrolls 4 times\ninstead of the expected 8 times. In fwprop1, the following optimization\n\n    (reg:RVVM1QI) = (subreg (reg:RVVM1x5QI) 0)\n    mem:RVVM1QI = (reg:RVVM1QI)\n\n    to \n\n    mem:RVVM1QI = (subreg (reg:RVVM1x5QI) 0)\n\nis evaluated asnot profitable, because this patch makes RVVM1QI and RVVM1x5QI \nnot tieable. The unroll factor in loop2_unroll is eventually decreased into 4 \nas this function has more rtl insns when missing this optimization.\nI am not sure about the performence impact, but I think it should be avoided.\nMaybe we can do as before, allow tuple mode tiebale to modes with same\ninner mode or just allow when this compared mode equals inner vector mode.\n\nAnd I am sorry that something wrong with my email and can not send cc emails\nto gmail. :(\nzicong","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 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 dmarc=none (p=none dis=none) header.from=masscore.cn","sourceware.org; spf=none smtp.mailfrom=masscore.cn","server2.sourceware.org;\n arc=none smtp.remote-ip=159.226.251.25"],"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 4g0sjh702Lz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:25:07 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D21874BA9024\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 08:25:03 +0000 (GMT)","from cstnet.cn (smtp25.cstnet.cn [159.226.251.25])\n by sourceware.org (Postfix) with ESMTPS id 4462A4BA2E07\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 08:24:04 +0000 (GMT)","from localhost.localdomain (unknown [118.112.177.130])\n by APP-05 (Coremail) with SMTP id zQCowACHGw+bhehpRfpKDg--.34111S2;\n Wed, 22 Apr 2026 16:23:55 +0800 (CST)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org D21874BA9024","OpenDKIM Filter v2.11.0 sourceware.org 4462A4BA2E07"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 4462A4BA2E07","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 4462A4BA2E07","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776846245; cv=none;\n b=xqlAtjE/LP9shouWR3Ajtrgn6zdS13Ga5FMA2l1ZUyqgMLzDqaGnkSQVfp0SaT16KYA9hpknGKL12OBmQlbo+HhhzpGprXfMlO/nMIwotUGreL4EF0kp8guvI4pSWL8+JEEEecC33Sy/eJZHNyGHn+USRrHf+zyfBGmsV1W09Jk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776846245; c=relaxed/simple;\n bh=QDy5EFIN90rfSchMqX7cSGk1Ap1V6TZlpUBAaIDfl/0=;\n h=From:To:Subject:Date:Message-Id:MIME-Version;\n b=XuozIsNlrLEx8QmgmU0mJymqpho1PmgD1OxCMjfyps0kf6GgJq0RcRcMBXCRyAf+cf4+mGRjxbDgn9sb3/46BGhj6m08/t8Df5KJLq1ZqioaMRuPW+Hl2XN1Q2p3Co0TxXfSof6aAOqaoxupsDDjgc/CkTMpjsZsh/grloMfnuo=","ARC-Authentication-Results":"i=1; server2.sourceware.org","From":"wangzicong <wangzicong@masscore.cn>","To":"gcc-patches@gcc.gnu.org","Subject":"Re: [PATCH v2] RISC-V: Make tuple vector not tieable to some modes.","Date":"Wed, 22 Apr 2026 16:23:54 +0800","Message-Id":"<20260422082354.3005477-1-wangzicong@masscore.cn>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20260415110301.1701251-1-wangzicong@masscore.cn>","References":"<20260415110301.1701251-1-wangzicong@masscore.cn>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-CM-TRANSID":"zQCowACHGw+bhehpRfpKDg--.34111S2","X-Coremail-Antispam":"1UD129KBjvdXoWrZF1fXFyfZw43Wry5tFy5Jwb_yoWfKFX_Wa\n 40gr1vk3W7uF1Dtw4fWF4ruFZ2gaya9r15JryYgrn7t34kurWqvayqyay7ZF1rW3s3WrnI\n kr1rGa4xu342gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT\n 9fnUUIcSsGvfJTRUUUbF8YjsxI4VWkKwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I\n 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2\n 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0\n cI8IcVCY1x0267AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z2\n 80aVCY1x0267AKxVW8JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE\n w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc\n vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2Iq\n xVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r\n 106r1rMI8E67AF67kF1VAFwI0_Jr0_JrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AK\n xVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7\n xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_\n GrUvcSsGvfC2KfnxnUUI43ZEXa7IU5PpnJUUUUU==","X-Originating-IP":"[118.112.177.130]","X-CM-SenderInfo":"pzdqw6xlfr0w46pd22pfruvhdfq/","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"}},{"id":3684083,"web_url":"http://patchwork.ozlabs.org/comment/3684083/","msgid":"<DI5PCLGQZYHX.2N3AMW9YM4U1L@gmail.com>","list_archive_url":null,"date":"2026-04-29T14:18:36","subject":"Re: [PATCH v2] RISC-V: Make tuple vector not tieable to some modes.","submitter":{"id":86205,"url":"http://patchwork.ozlabs.org/api/people/86205/","name":"Robin Dapp","email":"rdapp.gcc@gmail.com"},"content":"Sorry for the late reply. \n\n> I found that there are some failed testcases so had a look. It happens to \n> be the situation we discussed before.\n> So when compiling function f5 in \n> gcc.target/riscv/rvv/autovec/struct/struct_vect-1.c, GCC unrolls 4 times\n> instead of the expected 8 times. In fwprop1, the following optimization\n>\n>     (reg:RVVM1QI) = (subreg (reg:RVVM1x5QI) 0)\n>     mem:RVVM1QI = (reg:RVVM1QI)\n>\n>     to \n>\n>     mem:RVVM1QI = (subreg (reg:RVVM1x5QI) 0)\n>\n> is evaluated asnot profitable, because this patch makes RVVM1QI and RVVM1x5QI \n> not tieable. The unroll factor in loop2_unroll is eventually decreased into 4 \n> as this function has more rtl insns when missing this optimization.\n> I am not sure about the performence impact, but I think it should be avoided.\n> Maybe we can do as before, allow tuple mode tiebale to modes with same\n> inner mode or just allow when this compared mode equals inner vector mode.\n\nAh, yes makes sense.  While it might not matter in the particular example, we \ncan indeed access e.g. a RVVM1QI reg without copying and should keep that \nproperty exposed.  I think I misread your original (v1) code so I think with \nthe nits fixed it's good to go.  Maybe send a combined v3 still so the CI will \npick it up but that should be about it.\n\nThanks.","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=VmuHvn3T;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=VmuHvn3T","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=209.85.221.48"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4g5KDm6WKZz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:19:19 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9D1564BB5912\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 14:19:17 +0000 (GMT)","from mail-wr1-f48.google.com (mail-wr1-f48.google.com\n [209.85.221.48])\n by sourceware.org (Postfix) with ESMTPS id 851324BB58A9\n for <gcc-patches@gcc.gnu.org>; Wed, 29 Apr 2026 14:18:40 +0000 (GMT)","by mail-wr1-f48.google.com with SMTP id\n ffacd0b85a97d-43eada6d900so12086620f8f.0\n for <gcc-patches@gcc.gnu.org>; Wed, 29 Apr 2026 07:18:40 -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 ffacd0b85a97d-447b4216dedsm6822801f8f.13.2026.04.29.07.18.37\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Wed, 29 Apr 2026 07:18:37 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9D1564BB5912","OpenDKIM Filter v2.11.0 sourceware.org 851324BB58A9"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 851324BB58A9","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 851324BB58A9","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777472320; cv=none;\n b=sRK3GX82Vuyi46eZm/tf8T4s75Ebgz9aOaHkhEU5/mcdxBVKlPfWCt3Zs4a811Jb4yRR6NkpZ5089RDyNs3Za2+hTvQ8DAFXDIiQS3twd+OqWjUftdAKwd8ig7Y7tUAKiu4f72i7lBhkTSgOZStAPQUCOkNAbQOhuLaZimzDMqA=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777472320; c=relaxed/simple;\n bh=j1ndCp7rmN5OU8dsUOvVuGcT3krAC4LMB1x2vnRcJ90=;\n h=DKIM-Signature:Mime-Version:Date:Message-Id:Subject:To:From;\n b=nmecogpiHzFZhd707GtIbbh13b8eWEhdoItoanH8UG6or3nlOmG0iFW2u5NAaM74YKrl74rdOLuKJMkWsJe5eehTAhW2bMRsBywS4WZwdTe14LnLexYbsDAl36jSKEjd0wzQVzURQns0XOdj1Awl90bwRTEGlYE3O97JPz5E/Js=","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=1777472319; x=1778077119; darn=gcc.gnu.org;\n h=in-reply-to:references:from:to:cc:subject:message-id:date\n :content-transfer-encoding:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=uiPx4jfobEIxVDTv3sqh442gjQ25/1gR5hXeOQylExk=;\n b=VmuHvn3Tc6/BNE36Y8cfzhV130u4V6OS0q7rQN9DpYNOXyieP1ZNoYDw/seNiT9392\n XlwHdwWh09AS806tvftWy959DCkuyuNHLptyOdmM2qFpMSSDjK2HGSprYB11g/228qY/\n eBemG0cR2YQdCyv1mhHVFlwFrTNEGdxs9qzRs8+utqnJnABH7XKuSdTQRXtUnRjHSxnh\n 6fHGSAu8NZUJmOFEm8GHzieNZMd+9dBgaAaP2MMvP/2eDIPOQE9pRCUGit1mB278nrYZ\n ySffr01OFfcYwBCNrcYx95LdiUzuVEcgE/+rtmk7hmC9XCLYTdR1lParXEA17g/ga/6O\n y4lQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777472319; x=1778077119;\n h=in-reply-to:references:from:to:cc:subject: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=uiPx4jfobEIxVDTv3sqh442gjQ25/1gR5hXeOQylExk=;\n b=KVQl8sb/dUxW2hpJ8zmS1ec1TaY56pGTGjQVIkYnNQvp1YuUUbA9OX6WDMOQAEPeT5\n D2z0ok9/zuGCJjuFO5D3OiBU6tOfEDTb9Uy5SpTqnJLvfcE4T2OW1MMZ3FV1snQdiyjG\n E2MOSRxHwdYtgbXfu9D80VzbLMMfr1S4UlJxknDi4NgJhXQ8qsnb57OzwUJeA6okYkR0\n O3cu2PDFs3VTZP2WltKnU1n5PKnn+6khtHffkcodZlVvZeaWV7pLrYHUggQ4OvXDAqoN\n WtADbSz3snPMV00P+5zjrhXt0b0eHlfB1CLr/65iVoK1rx8qWPekiPpCrsxMEjVUtCZF\n i4tg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/gJUhLUfT2RsVNA/t6mKZ3r/sbFXllSeuxGTlEggaY9dYKdYpfbQ31iHwNK8TFVMVN2T4zTBuqWVLXuQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YyUrKX21BFLqlQLY/samX0ktVK5gq/vbjPeWIj1YHdCJm+2pDZH\n NCy5/36KOrdV6tWJhl+D8yQNkUrKJBD1ogSGo60D9VOXct0D7+6Q4rB9","X-Gm-Gg":"AeBDieuNHJTblULaWGwhM5CuY/85fkUq7jed8v/Pzqx3z1xq/RZBwek1aKM7lXy8GkO\n eBaeS+ILPvpnH9YoE6Ao+1yO4sfQaslNGbF5B/82BvcGT1CfNJDqEfc7tJnQB9rk8vETsRDDHDm\n bTenhra616p6WYx6xnbCMi5JbOJnddCti557AZXHtKUiKh9wfGWelsmKy4tOD7EfJnOn/BXFIn+\n d7Kr8+DIjnugELFXIERfPfXLGvkN/KU8tkkLDKZdHriVFGcv5XjADATJHU7X85Ea7aup2m0ibze\n 0kuRbxvO/OUJ65/cgBats4OG2P6jODT9piagr4PIouvmbVzGItumXuNj0fES3mTeywsXVKIWHel\n UTCWkZhzkfnhvC1Nxb+G/6QCTr7BgTY9Led0KRHqZ8j/qs9XZoTxBT1eFxAefZToti9kV/P4mf0\n wC/wyDbushmXEgSJapjVDVAE9jwmLlNKEb68iywWa3cDDfdBRIecGsF5ZYtM5XdhZI29Mk5tRDh\n VyuUYE=","X-Received":"by 2002:a05:6000:2006:b0:43d:7e6f:3816 with SMTP id\n ffacd0b85a97d-4464a72938fmr12704383f8f.40.1777472318972;\n Wed, 29 Apr 2026 07:18:38 -0700 (PDT)","Mime-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=UTF-8","Date":"Wed, 29 Apr 2026 16:18:36 +0200","Message-Id":"<DI5PCLGQZYHX.2N3AMW9YM4U1L@gmail.com>","Subject":"Re: [PATCH v2] RISC-V: Make tuple vector not tieable to some modes.","Cc":"\"Robin Dapp\" <rdapp.gcc@gmail.com>","To":"\"wangzicong\" <wangzicong@masscore.cn>, <gcc-patches@gcc.gnu.org>","From":"\"Robin Dapp\" <rdapp.gcc@gmail.com>","References":"<20260415110301.1701251-1-wangzicong@masscore.cn>\n <20260422082354.3005477-1-wangzicong@masscore.cn>","In-Reply-To":"<20260422082354.3005477-1-wangzicong@masscore.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"}}]