From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E494B3858D35 for ; Thu, 3 Aug 2023 12:14:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E494B3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E5D4F1F45F; Thu, 3 Aug 2023 12:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691064871; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bCYG7ZZt5uYzwPbOqotywsigoo++0eynrtJedugMsZ0=; b=BKKdzmazJQJnbHp84OHqH3UXbLpgkym7cgnkcrHMfh2G8ZtEVnAwte74DkuU2XcE08xjem dE+uZ6XdZOeGvn9qelsUikRWkLJ0oonvlmhJSoiwX+bsr1uCfS6vphiMb9bSJBk2+Z/PIK hDlrVgRJhJdg6Y6Y3yNY7NRF+zi49ec= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691064871; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bCYG7ZZt5uYzwPbOqotywsigoo++0eynrtJedugMsZ0=; b=zFHoBppckN0CAAnTXfFBr23S4BKgd6xaGOoMe4yKbso2Gje047cKFaraRm6A8yqQ4A92kp z+yO28Obm+D9OECA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D213F2C142; Thu, 3 Aug 2023 12:14:31 +0000 (UTC) Date: Thu, 3 Aug 2023 12:14:31 +0000 (UTC) From: Richard Biener To: Prathamesh Kulkarni cc: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization In-Reply-To: Message-ID: References: <20230728070552.50C1413276@imap2.suse-dmz.suse.de> <320f94c3-8805-ec64-dd4b-0454c8ecce14@gmail.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Thu, 3 Aug 2023, Prathamesh Kulkarni wrote: > On Wed, 2 Aug 2023 at 14:17, Richard Biener via Gcc-patches > wrote: > > > > On Mon, 31 Jul 2023, Jeff Law wrote: > > > > > > > > > > > On 7/28/23 01:05, Richard Biener via Gcc-patches wrote: > > > > The following delays sinking of loads within the same innermost > > > > loop when it was unconditional before. That's a not uncommon > > > > issue preventing vectorization when masked loads are not available. > > > > > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > > > > > > > I have a followup patch improving sinking that without this would > > > > cause more of the problematic sinking - now that we have a second > > > > sink pass after loop opts this looks like a reasonable approach? > > > > > > > > OK? > > > > > > > > Thanks, > > > > Richard. > > > > > > > > PR tree-optimization/92335 > > > > * tree-ssa-sink.cc (select_best_block): Before loop > > > > optimizations avoid sinking unconditional loads/stores > > > > in innermost loops to conditional executed places. > > > > > > > > * gcc.dg/tree-ssa/ssa-sink-10.c: Disable vectorizing. > > > > * gcc.dg/tree-ssa/predcom-9.c: Clone from ssa-sink-10.c, > > > > expect predictive commoning to happen instead of sinking. > > > > * gcc.dg/vect/pr65947-3.c: Adjust. > > > I think it's reasonable -- there's probably going to be cases where it's not > > > great, but more often than not I think it's going to be a reasonable > > > heuristic. > > > > > > If there is undesirable fallout, better to find it over the coming months than > > > next spring. So I'd suggest we go forward now to give more time to find any > > > pathological cases (if they exist). > > > > Agreed, I've pushed this now. > Hi Richard, > After this patch (committed in 399c8dd44ff44f4b496223c7cc980651c4d6f6a0), > pr65947-7.c "failed" for aarch64-linux-gnu: > FAIL: gcc.dg/vect/pr65947-7.c scan-tree-dump-not vect "LOOP VECTORIZED" > FAIL: gcc.dg/vect/pr65947-7.c -flto -ffat-lto-objects > scan-tree-dump-not vect "LOOP VECTORIZED" > > /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { > ! vect_fold_extract_last } } } } */ > > With your commit, condition_reduction in pr65947-7.c gets vectorized > regardless of vect_fold_extract_last, > which gates the above test (which is an improvement, because the > function didn't get vectorized before the commit). > > The attached patch thus removes the gating on vect_fold_extract_last, > and the test passes again. > OK to commit ? OK. Thanks, Richard.