From patchwork Mon Oct 25 10:49:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1545678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=eF1ZO6rI; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HdBYR49PXz9shn for ; Mon, 25 Oct 2021 21:50:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21ECD3858427 for ; Mon, 25 Oct 2021 10:50:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21ECD3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635159000; bh=S32jW0Vkpn83tWtc4Aj41X4889WLi554J53dHtXskfw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=eF1ZO6rIWZk33QB7xpo5BEb+Kdu8H9f9dFU+7KCfYBMJJkaTKcOzoOXyP6MJ1wT59 +tOlEjJcXCqWj+gm7IgN7wyXNFlmFQIssfAspLH/LhL5Y8FMXw4QeKUWXaY27N/ngI lU6UuG2125eckBtiboZCBeObY/PwkLqSqTFP01Q0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 2E4BA3858C27 for ; Mon, 25 Oct 2021 10:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E4BA3858C27 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3C8751FD37 for ; Mon, 25 Oct 2021 10:49:17 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 28DFA13BA4 for ; Mon, 25 Oct 2021 10:49:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TgnPCK2LdmFSBQAAMHmgww (envelope-from ) for ; Mon, 25 Oct 2021 10:49:17 +0000 Date: Mon, 25 Oct 2021 12:49:16 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/102905 - restore re-align load for alignment peeling Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Previous refactoring made the possibility of considering re-aligned loads for unlimited cost model alignment peeling difficult so I ditched that. Later refactoring made it easily possible again so the following patch re-instantiates this which should fix the observed regression on powerpc with altivec. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-10-25 Richard Biener PR tree-optimization/102905 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Use vect_supportable_dr_alignment again to determine whether an access is supported when not aligned. --- gcc/tree-vect-data-refs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 556ae9725f1..cbcd4b80246 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1994,9 +1994,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) prune all entries from the peeling hashtable which cause DRs to be not supported. */ bool supportable_if_not_aligned - = targetm.vectorize.support_vector_misalignment - (TYPE_MODE (vectype), TREE_TYPE (DR_REF (dr_info->dr)), - DR_MISALIGNMENT_UNKNOWN, false); + = vect_supportable_dr_alignment + (loop_vinfo, dr_info, vectype, DR_MISALIGNMENT_UNKNOWN); while (known_le (npeel_tmp, nscalars)) { vect_peeling_hash_insert (&peeling_htab, loop_vinfo,