From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 54A213858C2F for ; Thu, 5 Oct 2023 08:54:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54A213858C2F 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-wr1-x430.google.com with SMTP id ffacd0b85a97d-3248ac76acbso666869f8f.1 for ; Thu, 05 Oct 2023 01:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696496094; x=1697100894; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lB8IHzQ4xMefDTHXO9BDPfSYERo8NNLbOkpVArJodT4=; b=LT1bJv/qJMbj6DlOsyqohIjUkraS3NCOw0b6euKoGILS9TbafW6ZROw/x7ng9L1QCC wI6yYT5l5sjGzhHFIjhKGJWkdwI05XBo1sKS4GVE0ZXAzdoIdgi5P61jE5DBWJCRkA+7 7adpAhQS8t4QRcxqpuwlIup1QyOQVsGNH1nOFT01zA4gT3NEUzFxgujCQoD85dV407xt VGfKucb84sRYJx3EdJM5aKdQSfe33h2vobCi/1uOaohGSj+MMZ6WDq0Rtt60uubvwGb2 5bwpjw4uuSmYZnl6pkrt/9m67HUxTNFoqApin9+UDRlPYnbFgxsRILNdGA4SCQBmoq4N pr0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696496094; x=1697100894; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lB8IHzQ4xMefDTHXO9BDPfSYERo8NNLbOkpVArJodT4=; b=fyE7egrQgSVIujqWByZSH5H4ybRjow0rPNpvC/tNe4KbONJzgjp4OqQvhH33rxFwOA 0dbwgaE48m87eF/NPgklvPFfXKcQV+FZFH8j7fQR/Kc9k/9k6tg8TGXatTFXsm2lY//h c1hPU8P6v0qlxcBq3YK0sDN4PkiL0TQAcr1CTuJfwMZ0hES39w/IiYiVpTGgUU+sRcxF IFxCzUr7hCm1Xeh+0Kh92Xq/K6MH/F2x1+FDfCu9E/f9lQtKW75eppDFUfQMzMiSboKQ uOw8uTDuXbe0csTzOz7yOfQdz/ikDgU4KUJlQESP5+/nuEf8fhW0OD7iGSNzPcT4hNHI qH+A== X-Gm-Message-State: AOJu0YxdzZ4nwmNdrXFhYK62NsdmlOY49R7tp1gjHvowg55HUpzn8nvk rnxZWK/eqrJOO0xUsYqR8AZpXMt3J0Mz/A== X-Google-Smtp-Source: AGHT+IHj7pKR3VryZgZDnpxHdy1ij4i2UcA7L2TGAwDKFyqq1AcA4rZuyhq3UbvilZ34RHWk2wOzbA== X-Received: by 2002:a5d:5487:0:b0:319:6997:942e with SMTP id h7-20020a5d5487000000b003196997942emr4418592wrv.8.1696496093881; Thu, 05 Oct 2023 01:54:53 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id b10-20020a5d4b8a000000b003232380ffd5sm1260818wrt.106.2023.10.05.01.54.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 01:54:53 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 10:54:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Cc: rdapp.gcc@gmail.com Subject: Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction. Content-Language: en-US To: Tamar Christina , gcc-patches , Richard Biener References: <0193b63e-98dc-42bc-cd33-485361ea50bf@gmail.com> <671a575c-02ff-071b-967e-2e93d8986c1a@gmail.com> From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.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,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: Hi Tamar, > So in the > > if (slp_node) > { > > Add something like: > > If (is_cond_op) > { > if (dump_enabled_p ()) > dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, > "left fold reduction on SLP not supported.\n"); > return false; > } Yes, seems reasonable, added. > The only comment I have is whether you actually need this helper function? > It looks like all the uses of it are in cases you have, or will call conditional_internal_fn_code > directly. > > e.g. in vect_transform_reduction you can replace it by > > bool cond_fn_p = cond_fn != ERROR_MARK; > > and in > > if (cond_fn_p (orig_code)) > orig_code = conditional_internal_fn_code (internal_fn(orig_code)); > > just > > internal_fn new_fn = conditional_internal_fn_code (internal_fn(orig_code)); > if (new_fn != ERROR_MARK) > orig_code = new_fn; > > which would save the repeated testing of the condition. I see what you mean. One complication is that we want to disambiguate (among others): (1) code = IFN_COND_ADD, cond_fn = IFN_LAST. (new case) (2) code = IFN_MAX, cond_fn = IFN_COND_MAX. (3) code = IFN_SOMETHING, cond_fn = IFN_LAST. So just checking cond_fn is not enough (even if we made get_conditional_internal_fn (IFN_COND_ADD) return IFN_COND_ADD). We need to know if the initial code already was an IFN_COND. It's a bit of a mess but I didn't dare untangling. Well, actually, I tried but made it worse ;) The cond_fn_p check seemed least intrusive to me. Maybe you have another idea? Regards Robin