From patchwork Tue Feb 21 10:09:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 730401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vSGSd28Hfz9s0g for ; Tue, 21 Feb 2017 21:09:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PKSbgKjG"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Iy8LRN6ICa3q4HxrR1orqeTIuXy16yyrOVnxJ03HR6bgthnoq1 66lLMX45V94HF2mqYnNaSEAZRRJzmHFZzeqMV++5u8jh+qSRAmtYXyq/3ZKkCdAg PcpjTmQQ3aw0jnoYk/JLo//Fmp3Tt+wcZ5Fr0qe1gLK/w0lMvtTaiQG/I= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=Gl6+C8GdriEAR7BuBZRG63H7NMo=; b=PKSbgKjGRHmyQLqRI3QZ 5WN7Ek8feifx+XRHl8ixbkC44xYHEwC+lFwNXHo3nxJ9y6lhWnJGSyGRtb8OvGV9 eaS8BxUIF4KOiWzxpLOP2pty+68EoUmoCQ2rbW3Is8+EdRPVa4aJa95fL6Kv4GhW xEBWmczBDiW85GpxLfUdXT4= Received: (qmail 16768 invoked by alias); 21 Feb 2017 10:09:29 -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 16738 invoked by uid 89); 21 Feb 2017 10:09:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=manipulation X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Feb 2017 10:09:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 478731555C for ; Tue, 21 Feb 2017 10:09:27 +0000 (UTC) Received: from abulafia.quesejoda.com (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LA9PlU025726 for ; Tue, 21 Feb 2017 05:09:26 -0500 To: gcc-patches From: Aldy Hernandez Subject: loop versioning doc changes Message-ID: <376924d4-9721-4e73-6b79-79dc10015477@redhat.com> Date: Tue, 21 Feb 2017 05:09:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Found these while poking at loop versioning. Most importantly, we no longer have tree_ssa_loop_version, so I removed it from the docs. OK? gcc/ * doc/loop.texi (Loop manipulation): Remove nonexistent tree_ssa_loop_version from the documentation. * cfgloopmanip.c (loop_version): Document CONDITION_BB argument. diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index a0e3e30..3e34aad 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -1689,10 +1689,13 @@ lv_adjust_loop_entry_edge (basic_block first_head, basic_block second_head, This transformation given a condition and a loop, creates -if (condition) { loop_copy1 } else { loop_copy2 }, where loop_copy1 is the loop transformed in one way, and loop_copy2 - is the loop transformed in another way (or unchanged). 'condition' + is the loop transformed in another way (or unchanged). COND_EXPR may be a run time test for things that were not resolved by static analysis (overlapping ranges (anti-aliasing), alignment, etc.). + If non-NULL, CONDITION_BB is set to the basic block containing the + condition. + THEN_PROB is the probability of the then edge of the if. THEN_SCALE is the ratio by that the frequencies in the original loop should be scaled. ELSE_SCALE is the ratio by that the frequencies in the diff --git a/gcc/doc/loop.texi b/gcc/doc/loop.texi index b607e95..8535769 100644 --- a/gcc/doc/loop.texi +++ b/gcc/doc/loop.texi @@ -258,12 +258,11 @@ one of the edges entering loop header, thus performing either loop unrolling or loop peeling. @code{can_duplicate_loop_p} (@code{can_unroll_loop_p} on GIMPLE) must be true for the duplicated loop. -@item @code{loop_version}, @code{tree_ssa_loop_version}: These function -create a copy of a loop, and a branch before them that selects one of -them depending on the prescribed condition. This is useful for -optimizations that need to verify some assumptions in runtime (one of -the copies of the loop is usually left unchanged, while the other one is -transformed in some way). +@item @code{loop_version}: This function creates a copy of a loop, and +a branch before them that selects one of them depending on the +prescribed condition. This is useful for optimizations that need to +verify some assumptions in runtime (one of the copies of the loop is +usually left unchanged, while the other one is transformed in some way). @item @code{tree_unroll_loop}: Unrolls the loop, including peeling the extra iterations to make the number of iterations divisible by unroll factor, updating the exit condition, and removing the exits that now