From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id A1D613858D39 for ; Wed, 31 Aug 2022 16:08:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1D613858D39 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-pg1-x533.google.com with SMTP id f4so13873985pgc.12 for ; Wed, 31 Aug 2022 09:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=4tLo2k8Ax7OxeKzLS+qOa2QvaYvqiiSwlehXwwv/05E=; b=g0ObIOzfWvhLZOCV1hZAWHh+towUx5Q951IV6km30BNHb2peKr05Gv5nnonDks9GCY pjA8iLASq7UsEKnnjscDAY8+xF4xsjzyAksX9c51klh5/hQkJH90bP/xxgSGhBixm/Sz rGgwHsQpTDigoYnLwThTdIRFxCbO8TILOJQjD0zOG/HX//pXYvEx7LuOCNsQk8Gn2PVS xmXxLyZ4CWJgAahgh7t+nxKC7DtUgJqMzYnFLewQHLfiCq/fMEs+Gd38dxfwiaovLo7M 4R8MKMr6CJzwAeF5oc6fIQ6BNgv8F0N40hfLFohEzOeh0nucOZGAbwEFYiZi8LZqchUg y/XA== 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:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=4tLo2k8Ax7OxeKzLS+qOa2QvaYvqiiSwlehXwwv/05E=; b=goDTUgO8GZtEsgS8nN4teFD8DhFhk82YD3j/dt6BtvX0q1fRe3E6aIOecv2an4HcOP Y2RskAQbmvi7bh2UCgnsf462l4WPjQs8NwcpVdDomKiitghgxEA1X7Ser04Kz7wxSBoY mvL1yOk/SkntcO/zdc4VqHl5KSfnZSWUND4rqTP+Hv5cog5JIWG34f9csu4P3v5NHYk5 6E4ua6NSJyl78F416eqpBpKtH0lQws+GHsrMeTbRHiI2xcPcln+5LcN5T3BItJTXMJUu tjR5TnPiMrD+yLfaK8I6m8INiuLMOWYhZMNYehrXPnt3kNVrF2Pvfk58qBVMLEFePZKE 9ziw== X-Gm-Message-State: ACgBeo2h+WJ6gH2qxg6oaVHsliZPkvRYNJb0wVi8KEDoyJ/NgWindsw/ XyymMD9di9DGb58Dq1RlOzb6ZQpuEuk= X-Google-Smtp-Source: AA6agR4Fm0r+kRtS7xb3sRV4Xj5PLun9N1nxM/LnqQiGhRXXJN1X69y5yUAbgv8ywpamZZBzlTbwEQ== X-Received: by 2002:a62:1596:0:b0:537:c7e4:f106 with SMTP id 144-20020a621596000000b00537c7e4f106mr25564000pfv.42.1661962116998; Wed, 31 Aug 2022 09:08:36 -0700 (PDT) Received: from [172.31.0.204] (c-73-98-188-51.hsd1.ut.comcast.net. [73.98.188.51]) by smtp.gmail.com with ESMTPSA id s18-20020a170902ea1200b00172b616f375sm741122plg.228.2022.08.31.09.08.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 09:08:36 -0700 (PDT) Message-ID: Date: Wed, 31 Aug 2022 10:08:35 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH] middle-end: Add MULT_EXPR recognition for cond scalar reduction Content-Language: en-US To: gcc-patches@gcc.gnu.org References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SCC_BODY_URI_ONLY,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 8/25/2022 3:39 AM, Kong, Lingling via Gcc-patches wrote: > Hi, > > The conditional mult reduction cannot be recognized with current GCC. The following loop cannot be vectorized. > Now add MULT_EXPR recognition for conditional scalar reduction. > > float summa(int n, float *arg1, float *arg2) > { > int i; > float res1 = 1.0; > for(i = 0; i < n; i++) { > if(arg2[i]) > res1 *= arg1[i]; > } > return res1; > } > > gcc/ChangeLog: > > * tree-if-conv.cc (is_cond_scalar_reduction): Add MULT_EXPR > recognition. > > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/gen-vect-34.c: New test. > * gcc.dg/vect/vect-ifcvt-18.c: New test. OK jeff