From patchwork Thu Jul 12 13:42:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 943048 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-481428-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TVjGeoQb"; 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 41RHDy1BnNz9s1R for ; Thu, 12 Jul 2018 23:42:40 +1000 (AEST) 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=BiRvGDYMntTwCHJ5hUBZiuXPHGY5g3IJizSKwcGUI6i6jR0SFITP9 Y8Wys6L1l7uGY2V0orcH68s9WkbInMt1JFv/HYnqVfCmVtnLZ2uqS6I3it32JOIb Tj/d/10gY7hPoSZsWRLdz6gk/Z4ABzxzvn8Ww7Rq+P4Q86jO68nY2Q= 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=yPb0YWzYto1SZyQ1O1DX0/Tl7z8=; b=TVjGeoQbIaZjJTNqquUc mJ4kLuPsJSiqkJt4J5lmzdyzSW1+I4qGsodpLBiO4cSbfYJam7u3zmIoJyURmj/b F8oO26nP/UM1Q901EiBynOnEjuR8R8hB0ZnvKWmDmAs6cVj9vUvkaB0MtAQKh/VC 8/h37pjG8HP9DN1Rq2jJCbk= Received: (qmail 33980 invoked by alias); 12 Jul 2018 13:42:34 -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 33959 invoked by uid 89); 12 Jul 2018 13:42:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=sk:lto_out, sk:ipa_wri X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 13:42:31 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id AA6EA543578; Thu, 12 Jul 2018 15:42:28 +0200 (CEST) Date: Thu, 12 Jul 2018 15:42:28 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Add dump file for WPA streaming Message-ID: <20180712134228.GF94468@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Hi, this patch adds dump file for WPA streaming process. It uses the new dump file code for parittions. Bootstrapped/regtsted x86_64-linux, will commit it shortly. Honza * lto.c (do_stream_out): Add PART parameter; open dump file. (stream_out): Add PART parameter; pass it to do_stream_out. (lto_wpa_write_files): Update call of stream_out. * lto-streamer-out.c (copy_function_or_variable): Dump info about copying section. Index: lto/lto.c =================================================================== --- lto/lto.c (revision 262591) +++ lto/lto.c (working copy) @@ -2326,13 +2326,15 @@ static lto_file *current_lto_file; /* Actually stream out ENCODER into TEMP_FILENAME. */ static void -do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder) +do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder, int part) { lto_file *file = lto_obj_file_open (temp_filename, true); if (!file) fatal_error (input_location, "lto_obj_file_open() failed"); lto_set_current_out_file (file); + gcc_assert (!dump_file); + streamer_dump_file = dump_begin (TDI_lto_stream_out, NULL, part); ipa_write_optimization_summaries (encoder); free (CONST_CAST (char *, file->filename)); @@ -2340,6 +2342,11 @@ do_stream_out (char *temp_filename, lto_ lto_set_current_out_file (NULL); lto_obj_file_close (file); free (file); + if (streamer_dump_file) + { + dump_end (TDI_lto_stream_out, streamer_dump_file); + streamer_dump_file = NULL; + } } /* Wait for forked process and signal errors. */ @@ -2372,14 +2379,14 @@ wait_for_child () static void stream_out (char *temp_filename, lto_symtab_encoder_t encoder, - bool ARG_UNUSED (last)) + bool ARG_UNUSED (last), int part) { #ifdef HAVE_WORKING_FORK static int nruns; if (lto_parallelism <= 1) { - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); return; } @@ -2399,12 +2406,12 @@ stream_out (char *temp_filename, lto_sym if (!cpid) { setproctitle ("lto1-wpa-streaming"); - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); exit (0); } /* Fork failed; lets do the job ourseleves. */ else if (cpid == -1) - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); else nruns++; } @@ -2412,13 +2419,13 @@ stream_out (char *temp_filename, lto_sym else { int i; - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); for (i = 0; i < nruns; i++) wait_for_child (); } asm_nodes_output = true; #else - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); #endif } @@ -2508,7 +2515,7 @@ lto_wpa_write_files (void) } gcc_checking_assert (lto_symtab_encoder_size (part->encoder) || !i); - stream_out (temp_filename, part->encoder, i == n_sets - 1); + stream_out (temp_filename, part->encoder, i == n_sets - 1, i); part->encoder = NULL; Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 262591) +++ lto-streamer-out.c (working copy) @@ -2293,6 +2304,8 @@ copy_function_or_variable (struct symtab struct lto_in_decl_state *in_state; struct lto_out_decl_state *out_state = lto_get_out_decl_state (); + if (streamer_dump_file) + fprintf (streamer_dump_file, "Copying section for %s\n", name); lto_begin_section (section_name, false); free (section_name);