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: 46597 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 662AB3858427 for ; Mon, 25 Oct 2021 10:49:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 662AB3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635158988; bh=S32jW0Vkpn83tWtc4Aj41X4889WLi554J53dHtXskfw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BT7KkyPOdsS2qpCMutGC9nwaqah4PU6Nvz5PNf5J99ZoOAoqhhImxTgniTKAczp91 6A8q8+g1mwsSeBYFJPZhHMbIfrDyEqnW9NVLTznlUz0tmpsEWr79bVjGb01Xjqe8IC aRrzTUPn8q7KgKAJ+UvB25r/nxHNixK1/WYx/tg0= 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+patchwork=sourceware.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,