From patchwork Fri Aug 7 08:42:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: max X-Patchwork-Id: 505035 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 DF809140297 for ; Fri, 7 Aug 2015 18:42:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=V/l0h5iO; 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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=tQzSmEObSzFj3ILu+Dez+Zlov6wgASaMUzNxDlEKMD1 E6/U7J2jFhvuO1BtwKcrAL3nbtdLcqIBnLlmzZJSbE5jkRZjZg45gsFa3EkrmOcA ZXdf/Cu7l5USGwwTo+eOvqpVU0cLDJ494ir7dZxx/zSH7QhpOa2R8v8mbkcd8MP8 = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=Kg/JU2J98TcyoAAVADEIMrmQZYY=; b=V/l0h5iOF65FMkhhO vniRxQDHc7WVi71cm+i+bu5oKBO3ukAVO4IvVLp26pmFm1Q5v8H8oKFYbtOD+fKU DkASZXfKEH1Ejf1dwgAgKRNqoQZjU1FXyttCtbS93zLBAHNBEGf02dU4EGREzjHu FoZcR1d3MA11FEfpam38C7TBz4= Received: (qmail 1098 invoked by alias); 7 Aug 2015 08:42:30 -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 1086 invoked by uid 89); 7 Aug 2015 08:42:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_40, HDRS_LCASE, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS, T_MANY_HDRS_LCASE autolearn=no version=3.3.2 X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Aug 2015 08:42:27 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSP00HIGEUK5P50@mailout4.w1.samsung.com> for gcc-patches@gcc.gnu.org; Fri, 07 Aug 2015 09:42:20 +0100 (BST) Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id FE.CF.05269.C6F64C55; Fri, 7 Aug 2015 09:42:20 +0100 (BST) Received: from [106.109.128.167] by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NSP00LUEEUJFL70@eusync2.samsung.com>; Fri, 07 Aug 2015 09:42:20 +0100 (BST) Message-id: <55C46F6B.7090506@partner.samsung.com> Date: Fri, 07 Aug 2015 11:42:19 +0300 From: Maxim Ostapenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-version: 1.0 To: GCC Patches Cc: Jakub Jelinek , Yury Gribov , Slava Garbuzov Subject: [RFC][PATCH, ASan] ASan and TSan passes place change. Content-type: multipart/mixed; boundary=------------050306030506010106010700 X-IsSubscribed: yes Hi! This tiny patch moves ASan and TSan passes just before sanopt pass, that gives nice speedup on several SPEC2006 tests (-O2 optimization level was used) on x86: TESTCASE ORIGINAL PATCHED SPEEDUP 401.bzip2 806 798 0.99% 403.gcc 506 475 6.13% 429.mcf 337 295 12.46% 456.hmmer 1005 1017 -1.19% 458.sjeng 993 946 4.73% 462.libquantum 312 290 7.05% 473.astar 550 539 2.00% 483.xalancbmk 439 363 17.31% 410.bwaves 1720 1712 0.47% 416.gamess 3101 3105 -0.13% 433.milc 469 358 23.67% 434.zeusmp 1497 1499 -0.13% 435.gromacs 926 905 2.27% 436.cactusADM 2572 2612 -1.56% 437.leslie3d 1472 1470 0.14% 444.namd 474 452 4.64% 447.dealII 505 429 15.05% 459.GemsFDTD 1812 1812 0.00% 465.tonto 1289 1292 -0.23% 470.lbm 302 228 24.50% 482.sphinx3 1030 617 40.10% Does this change looks reasonable for trunk? -Maxim diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff02e19..560c277 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-08-07 Maxim Ostapenko + + * asan.c (make_pass_asan_O0): Remove pass. + * tsan.c (make_pass_tsan_O0): Likewise. + * passes.def: Change place for ASan and TSan passes. + * tree-pass.h: Remove passes. + 2015-08-05 Richard Biener PR tree-optimization/67055 diff --git a/gcc/asan.c b/gcc/asan.c index 4f5adaa..b651ddb 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -2788,40 +2788,4 @@ make_pass_asan (gcc::context *ctxt) return new pass_asan (ctxt); } -namespace { - -const pass_data pass_data_asan_O0 = -{ - GIMPLE_PASS, /* type */ - "asan0", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - TV_NONE, /* tv_id */ - ( PROP_ssa | PROP_cfg | PROP_gimple_leh ), /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_update_ssa, /* todo_flags_finish */ -}; - -class pass_asan_O0 : public gimple_opt_pass -{ -public: - pass_asan_O0 (gcc::context *ctxt) - : gimple_opt_pass (pass_data_asan_O0, ctxt) - {} - - /* opt_pass methods: */ - virtual bool gate (function *) { return !optimize && gate_asan (); } - virtual unsigned int execute (function *) { return asan_instrument (); } - -}; // class pass_asan_O0 - -} // anon namespace - -gimple_opt_pass * -make_pass_asan_O0 (gcc::context *ctxt) -{ - return new pass_asan_O0 (ctxt); -} - #include "gt-asan.h" diff --git a/gcc/passes.def b/gcc/passes.def index 6b66f8f..a0ca2e7 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -217,8 +217,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_split_crit_edges); NEXT_PASS (pass_pre); NEXT_PASS (pass_sink_code); - NEXT_PASS (pass_asan); - NEXT_PASS (pass_tsan); /* Pass group that runs when 1) enabled, 2) there are loops in the function. Make sure to run pass_fix_loops before to discover/remove loops before running the gate function @@ -349,8 +347,8 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_lower_vaarg); NEXT_PASS (pass_lower_vector); NEXT_PASS (pass_lower_complex_O0); - NEXT_PASS (pass_asan_O0); - NEXT_PASS (pass_tsan_O0); + NEXT_PASS (pass_asan); + NEXT_PASS (pass_tsan); NEXT_PASS (pass_sanopt); NEXT_PASS (pass_cleanup_eh); NEXT_PASS (pass_lower_resx); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aab1f85..b5e22ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-08-07 Maxim Ostapenko + + * c-c++-common/asan/inc.c: Adjust. + 2015-08-05 Paolo Carlini PR c++/66595 diff --git a/gcc/testsuite/c-c++-common/asan/inc.c b/gcc/testsuite/c-c++-common/asan/inc.c index 5abf373..495195c 100644 --- a/gcc/testsuite/c-c++-common/asan/inc.c +++ b/gcc/testsuite/c-c++-common/asan/inc.c @@ -1,4 +1,4 @@ -/* { dg-options "-fdump-tree-asan0" } */ +/* { dg-options "-fdump-tree-asan" } */ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ @@ -16,5 +16,5 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "ASAN_" 1 "asan0" } } */ -/* { dg-final { scan-tree-dump "ASAN_CHECK \\(.*, 4\\);" "asan0" } } */ +/* { dg-final { scan-tree-dump-times "ASAN_" 1 "asan" } } */ +/* { dg-final { scan-tree-dump "ASAN_CHECK \\(.*, 4\\);" "asan" } } */ diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 7b66a1c..ab31d26 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -340,9 +340,7 @@ extern simple_ipa_opt_pass *make_pass_ipa_chkp_produce_thunks (gcc::context *ctx extern gimple_opt_pass *make_pass_chkp (gcc::context *ctxt); extern gimple_opt_pass *make_pass_chkp_opt (gcc::context *ctxt); extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt); -extern gimple_opt_pass *make_pass_asan_O0 (gcc::context *ctxt); extern gimple_opt_pass *make_pass_tsan (gcc::context *ctxt); -extern gimple_opt_pass *make_pass_tsan_O0 (gcc::context *ctxt); extern gimple_opt_pass *make_pass_lower_cf (gcc::context *ctxt); extern gimple_opt_pass *make_pass_refactor_eh (gcc::context *ctxt); extern gimple_opt_pass *make_pass_lower_eh (gcc::context *ctxt); diff --git a/gcc/tsan.c b/gcc/tsan.c index 56fb7b2..bcfadbf 100644 --- a/gcc/tsan.c +++ b/gcc/tsan.c @@ -860,44 +860,3 @@ make_pass_tsan (gcc::context *ctxt) return new pass_tsan (ctxt); } -namespace { - -const pass_data pass_data_tsan_O0 = -{ - GIMPLE_PASS, /* type */ - "tsan0", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - TV_NONE, /* tv_id */ - ( PROP_ssa | PROP_cfg ), /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_update_ssa, /* todo_flags_finish */ -}; - -class pass_tsan_O0 : public gimple_opt_pass -{ -public: - pass_tsan_O0 (gcc::context *ctxt) - : gimple_opt_pass (pass_data_tsan_O0, ctxt) - {} - - /* opt_pass methods: */ - virtual bool gate (function *) - { - return ((flag_sanitize & SANITIZE_THREAD) != 0 && !optimize - && !lookup_attribute ("no_sanitize_thread", - DECL_ATTRIBUTES (current_function_decl))); - } - - virtual unsigned int execute (function *) { return tsan_pass (); } - -}; // class pass_tsan_O0 - -} // anon namespace - -gimple_opt_pass * -make_pass_tsan_O0 (gcc::context *ctxt) -{ - return new pass_tsan_O0 (ctxt); -}