From patchwork Mon Oct 8 17:27:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 980670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-487151-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sw+EUBQC"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42TS4Q04WDz9s3C for ; Tue, 9 Oct 2018 04:28:04 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=Eso9H0SIQB1/xGVr/GpJ0drjbLZHpdq4rqhYEnvWc6GTClWgdRPc/ xaJqQSs3L84hmT1ZscJajFgR5hH5hYXULYRBF+u38OzVh3w8qH4D8RZiFo2nwFzG R8I6cNz47/489tvGiXahS4t0WGfqxSYEeXFB5onlT1cURFhSJIb1ss= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=8xhl5FPy+g+ZkzcTlUe8CGbd2L4=; b=sw+EUBQCh8WtPCa2LKad /+lNJkz8E3zox5GMTN80GrbhohlW12blSJN5Seu5OybToTXaK9KJjwoW6JFg6ZR7 j073v3Gz9Qs1HcFmnB5w9JxE9fxbabxWCp/A1i9b7FuO7a/Red82/GaxixBEUPU9 w4KIqj2GAirCHxRKH7gdIqk= Received: (qmail 119902 invoked by alias); 8 Oct 2018 17:27:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 119890 invoked by uid 89); 8 Oct 2018 17:27:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=tre X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Oct 2018 17:27:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2E7BDED1 for ; Mon, 8 Oct 2018 10:27:53 -0700 (PDT) Received: from localhost (unknown [10.32.99.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA6503F5D3 for ; Mon, 8 Oct 2018 10:27:52 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Use FOR_EACH_IMM_USE_FAST in gimple-ssa-backprop.c Date: Mon, 08 Oct 2018 18:27:51 +0100 Message-ID: <874ldwtkko.fsf@arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 As pointed out by Richard in PR63155. It speeds up the testcase a few %. Tested on aarch64-linux-gnu. OK to install? Richard 2018-10-08 Richard Sandiford gcc/ PR middle-end/63155 * gimple-ssa-backprop.c (backprop::intersect_uses): Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT. Index: gcc/gimple-ssa-backprop.c =================================================================== --- gcc/gimple-ssa-backprop.c 2018-06-18 15:22:36.918297134 +0100 +++ gcc/gimple-ssa-backprop.c 2018-10-08 18:27:00.874770262 +0100 @@ -496,10 +496,11 @@ backprop::process_use (gimple *stmt, tre backprop::intersect_uses (tree var, usage_info *info) { imm_use_iterator iter; - gimple *stmt; + use_operand_p use_p; *info = usage_info::intersection_identity (); - FOR_EACH_IMM_USE_STMT (stmt, iter, var) + FOR_EACH_IMM_USE_FAST (use_p, iter, var) { + gimple *stmt = USE_STMT (use_p); if (is_gimple_debug (stmt)) continue; gphi *phi = dyn_cast (stmt); @@ -523,10 +524,7 @@ backprop::intersect_uses (tree var, usag process_use (stmt, var, &subinfo); *info &= subinfo; if (!info->is_useful ()) - { - BREAK_FROM_IMM_USE_STMT (iter); - return false; - } + return false; } } return true;