From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 43BE23858C2C for ; Mon, 13 Feb 2023 14:39:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43BE23858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62e.google.com with SMTP id v23so13712520plo.1 for ; Mon, 13 Feb 2023 06:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5574b0UJh41e1RU1zLOvSgDZjUW4BoYlsNvAspB6ojU=; b=HHWm6l7h98xxk75g8FRLNjFX4om/0RAVP3ntsvphWtRXxLG8VdDFMx08JGapL+Hp6w lClcLol4lHybAX65WuZG5wVirHHAzUf/L1Qw2APnUxQeTHK5IAtKAqV5guTYa8wuBx33 lW+LdNIUf/lrXcKJeE0G/71a+gsMzXEgUiAK86JkFoQ+iUTOuRxN0FfLWZnbjCepoaXJ sw98FDJ/c5AqRH259l71IuGwmq4aWTohs+7xGSWSZpo0rJ24wsf+4mb0qmdlO83s1Gg6 HCXvhRrGZBAOJHyb5irHovPeGrQKfl07aQiI+92fjB+ffTDvhSzV7DsLuV3xGnvdaYie 1w2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5574b0UJh41e1RU1zLOvSgDZjUW4BoYlsNvAspB6ojU=; b=wvS6Gk7Z9DpZNVSyuccoRgfU1cnwpTlb3vky4WAAKvO7Df7pL8h6wGgA+4bMZwcoLU CDbb38uvYeKb1kgvrTiK4xV0lKI9RCe+Le21l5Yx0Wa/dbdjBrNzB4tcwZyrFGsIGm87 SfTF2ikDfLnqGDAAAghCufQ4ubxex/w4bp42Ky4xWTqhrRNlXF3cqDVWwsps3OlS3N98 HiZga8i2vbcvViHeXF0YShpFFPpRpFMADyDia4ObaMFevy3Yt5ne7yRaOwj7BJFf/DWl 0CIB0JtwsjY9DqIWl2fR6Ur/s1dTZSB+dsq7y1CksyzjuV1Kqv9NP4vKJvbb2t3LEIUj 7ohQ== X-Gm-Message-State: AO0yUKXXOhfDPShMeM/h/Z9wlGiPVqjccubyDjEFRovSaQM6PnyI+DCA KLTqg0OPDdj3DSGaA/rSemM= X-Google-Smtp-Source: AK7set9mq0V9KK8t3fLt6Cfg7Nwf40zDRKiP6C0sUBE5gH8mrdEPfXkMl1xLbQBifL+CEVmHV3A+aQ== X-Received: by 2002:a17:90b:3b82:b0:230:ae93:2677 with SMTP id pc2-20020a17090b3b8200b00230ae932677mr25777432pjb.29.1676299169890; Mon, 13 Feb 2023 06:39:29 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id r5-20020a638f45000000b00496317241f9sm7355423pgn.51.2023.02.13.06.39.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Feb 2023 06:39:29 -0800 (PST) Message-ID: <5abeaa51-b37a-b1c3-ca55-ca5047e6fa8f@gmail.com> Date: Mon, 13 Feb 2023 07:39:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] tree-optimization/108724 - vectorized code getting piecewise expanded Content-Language: en-US To: Richard Biener , gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com References: <20230210110247.514FA385B53C@sourceware.org> From: Jeff Law In-Reply-To: <20230210110247.514FA385B53C@sourceware.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 2/10/23 04:02, Richard Biener via Gcc-patches wrote: > This fixes an oversight to when removing the hard limits on using > generic vectors for the vectorizer to enable both SLP and BB > vectorization to use those. The vectorizer relies on vector lowering > to expand plus, minus and negate to bit operations but vector > lowering has a hard limit on the minimum number of elements per > work item. Vectorizer costs for the testcase at hand work out > to vectorize a loop with just two work items per vector and that > causes element wise expansion and spilling. > > The fix for now is to re-instantiate the hard limit, matching what > vector lowering does. For the future the way to go is to emit the > lowered sequence directly from the vectorizer instead. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > Thanks, > Richard. > > PR tree-optimization/108724 > * tree-vect-stmts.cc (vectorizable_operation): Avoid > using word_mode vectors when vector lowering will > decompose them to elementwise operations. > > * gcc.target/i386/pr108724.c: New testcase. OK. Though can't this be a problem with logicals too? Or is there something special about +- going on here? jeff