From patchwork Wed May 15 12:07:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 244053 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 4087A2C009C for ; Wed, 15 May 2013 22:07:49 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=pybaIQv4B9tSbcuVtfLDHdr8t/rl7vuZ3HTbMGAHIcYU9vdhJl7r+ 5PBcEVNNp5GYB56tMiOhqbSwbbeiO+1JnfM6Op+vCN/pCN3YUXNxbqMsfAoOWdKv gANlzwbcPjQ+W7ndCRA9VfdWIq7XGORjrzoZPSNTiTeFIiaroDSkqU= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=xm4VSzuW0fRXfJqiEUTZCQIUb20=; b=IUrTuh9oPNC8ByKoXSkH qcRFp6wrqVm6ycpI4arSdON1PGdaIJ3r6eeFZ7ToGzaUEHqCsuEpW8rY/S2R8YQO EI9ryKtcejHqOjXL4R1B3Zm8tFkl5dGXdJhTEUX2qaU7Kssyr5pIm6ifqq4twc8f h9lMBmfWmIMjpk7fJi6WETE= Received: (qmail 1537 invoked by alias); 15 May 2013 12:07:39 -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 1527 invoked by uid 89); 15 May 2013 12:07:38 -0000 X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 15 May 2013 12:07:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4FC7aNB016016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 May 2013 08:07:36 -0400 Received: from redhat.com (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4FC7WFR006691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 15 May 2013 08:07:35 -0400 Date: Wed, 15 May 2013 14:07:31 +0200 From: Marek Polacek To: GCC Patches Subject: [PATCH] Add SCEV cprop dump Message-ID: <20130515120731.GB14240@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) This is an attempt to add more dumping to scev_cprop. I don't know what exactly would you want to see in there, so now it prints e.g.: (replace_stmt (virtual_p_1 with 0) ) and (final_value_replacement o__lsm.3_2 = PHI <_6(4)> with o__lsm.3_2 = pretmp_10 + 20; ) Comments? Maybe that first hunk isn't really neccessary. 2013-05-15 Marek Polacek * tree-scalar-evolution.c (scev_const_prop): Add more dumps. Marek --- gcc/tree-scalar-evolution.c.mp 2013-05-15 13:43:31.020698846 +0200 +++ gcc/tree-scalar-evolution.c 2013-05-15 13:43:58.080788354 +0200 @@ -3295,7 +3295,17 @@ scev_const_prop (void) /* Replace the uses of the name. */ if (name != ev) - replace_uses_by (name, ev); + { + replace_uses_by (name, ev); + if (dump_file && (dump_flags & TDF_SCEV)) + { + fprintf (dump_file, "(replace_stmt \n ("); + print_generic_expr (dump_file, name, 0); + fprintf (dump_file, " with "); + print_generic_expr (dump_file, ev, 0); + fprintf (dump_file, ")\n) \n"); + } + } if (!ssa_names_to_remove) ssa_names_to_remove = BITMAP_ALLOC (NULL); @@ -3391,6 +3401,12 @@ scev_const_prop (void) /* Eliminate the PHI node and replace it by a computation outside the loop. */ + if (dump_file && (dump_flags & TDF_SCEV)) + { + fprintf (dump_file, "(final_value_replacement \n "); + print_gimple_stmt (dump_file, phi, 0, 0); + fprintf (dump_file, " with \n "); + } def = unshare_expr (def); remove_phi_node (&psi, false); @@ -3398,6 +3414,11 @@ scev_const_prop (void) true, GSI_SAME_STMT); ass = gimple_build_assign (rslt, def); gsi_insert_before (&bsi, ass, GSI_SAME_STMT); + if (dump_file && (dump_flags & TDF_SCEV)) + { + print_gimple_stmt (dump_file, ass, 0, 0); + fprintf (dump_file, ") \n"); + } } } return 0;