From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id B79FC384F73F for ; Mon, 12 Dec 2022 16:53:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B79FC384F73F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz 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-out1.suse.de (Postfix) with ESMTPS id F00523393D; Mon, 12 Dec 2022 16:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1670864028; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=p5DPHS+I9G6BlF5y2UdIJx4prSiA8jAM+o79QYv5QR0=; b=e2t6OiGTczvVc9XB7znNPIM5Sbxec6ZnXX++xPDLvAkvPLYh5xs/tvL8cdwDY+uFPAwKxN j1PKuEuCRNmOpsKXD8xoKVXLfZ63+aY69Y+xySGirJX4GORTM+AmACnTiG/nBOJ4VUas/9 +4VNGoDiJorBqU0KtNrBJZAQxH4SQZE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1670864028; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=p5DPHS+I9G6BlF5y2UdIJx4prSiA8jAM+o79QYv5QR0=; b=8Kfwn68gSZ+FvoSiQ7gE3Oq0228m5KNSN9KtGl0BROjaPWp6tKsVQ7QN5UCWIWr6EBnjv9 AGilPrhFUWOpanAQ== 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 D600013456; Mon, 12 Dec 2022 16:53:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fRg6NJxcl2M5EwAAMHmgww (envelope-from ); Mon, 12 Dec 2022 16:53:48 +0000 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka , Jan Hubicka Subject: [PATCH 8/9] ipa-sra: Make scan_expr_access bail out on uninteresting expressions User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Mon, 12 Dec 2022 17:53:48 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, I'm re-posting patches which I have posted at the end of stage 1 but which have not passed review yet. 8<-------------------------------------------------------------------- I have noticed that scan_expr_access passes all the expressions it gets to get_ref_base_and_extent even when we are really only interested in memory accesses. So bail out when the expression is something clearly uninteresting. Bootstrapped and tested individually when I originally posted it and now bootstrapped and LTO-bootstrapped and tested as part of the whole series. OK for master? gcc/ChangeLog: 2021-12-14 Martin Jambor * ipa-sra.c (scan_expr_access): Bail out early if expr is something we clearly do not need to pass to get_ref_base_and_extent. --- gcc/ipa-sra.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc index 93fceeafc73..3646d71468c 100644 --- a/gcc/ipa-sra.cc +++ b/gcc/ipa-sra.cc @@ -1748,6 +1748,11 @@ scan_expr_access (tree expr, gimple *stmt, isra_scan_context ctx, || TREE_CODE (expr) == REALPART_EXPR) expr = TREE_OPERAND (expr, 0); + if (!handled_component_p (expr) + && !DECL_P (expr) + && TREE_CODE (expr) != MEM_REF) + return; + base = get_ref_base_and_extent (expr, &poffset, &psize, &pmax_size, &reverse); if (TREE_CODE (base) == MEM_REF) -- 2.38.1