From patchwork Sat Dec 3 00:03:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 129000 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]) by ozlabs.org (Postfix) with SMTP id 13F161007D4 for ; Sat, 3 Dec 2011 11:05:44 +1100 (EST) Received: (qmail 20566 invoked by alias); 3 Dec 2011 00:05:40 -0000 Received: (qmail 20556 invoked by uid 22791); 3 Dec 2011 00:05:31 -0000 X-SWARE-Spam-Status: No, hits=0.5 required=5.0 tests=AWL, BAYES_50, RP_MATCHES_RCVD, TBC, TW_FN, TW_FP, TW_WP X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Dec 2011 00:05:06 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 02 Dec 2011 16:05:04 -0800 X-ExtLoop1: 1 Received: from azsmsx603.amr.corp.intel.com ([10.2.161.23]) by azsmga001.ch.intel.com with ESMTP; 02 Dec 2011 16:05:04 -0800 Received: from azsmsx502.amr.corp.intel.com ([10.2.121.75]) by azsmsx603.amr.corp.intel.com ([10.2.161.23]) with mapi; Fri, 2 Dec 2011 17:05:04 -0700 From: "Iyer, Balaji V" To: "H.J. Lu" CC: "gcc-patches@gcc.gnu.org" Date: Fri, 2 Dec 2011 17:03:38 -0700 Subject: RE: FW: [PATCH][Cilkplus] Low cost annotations implementation Message-ID: <2950715866004049A240A2F9BB410E7315FB28F617@azsmsx502.amr.corp.intel.com> References: <2950715866004049A240A2F9BB410E7315FB28F612@azsmsx502.amr.corp.intel.com> <2950715866004049A240A2F9BB410E7315FB28F614@azsmsx502.amr.corp.intel.com> <2950715866004049A240A2F9BB410E7315FB28F615@azsmsx502.amr.corp.intel.com>, In-Reply-To: MIME-Version: 1.0 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 Hello H. J., I fixed the dates also. Thanks, Balaji V. Iyer. diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index c76e5bf..a41fb1b 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,19 @@ +2011-12-02 Balaji V. Iyer + + * cilk.c (cilk_init_builtins): Removed prefixing undescores from + cilk_spawn_prepare and cilk_spawn_or_continue. + (get_zca_table_size): Added 1 to length of string. + (output_zca_section): Likewise. + (cilk_output_metadata): Added a '0' to indicate end of string. Also + removed 'w' from the section type. Finally, changed the entry count + size from 4 to 2. + (expand_builtin_cilk_metadata): Flipped the bytes of dwarf_expr in two + places. + (output_string_table): Removed unnecessary curly braces. + (cilk_remove_annotated_functions): Likewise. + * dwarf2out.c (dwarf2out_var_location): Make early return if cilk is + enabled. + 2011-11-11 Balaji V. Iyer * opts.c: Removed the CILKPLUS_IMPLEMENTED macro and the #ifdef and diff --git a/gcc/cilk.c b/gcc/cilk.c index ed13d9f..d9da0f8 100644 --- a/gcc/cilk.c +++ b/gcc/cilk.c @@ -349,9 +349,9 @@ cilk_init_builtins (void) cilk_enter_end_fndecl = install_builtin ("cilk_enter_end", fptr_fun, BUILT_IN_CILK_ENTER_END, true); cilk_spawn_prepare_fndecl = install_builtin - ("__cilk_spawn_prepare", fptr_fun, BUILT_IN_CILK_SPAWN_PREPARE, true); + ("cilk_spawn_prepare", fptr_fun, BUILT_IN_CILK_SPAWN_PREPARE, true); cilk_spawn_or_cont_fndecl = install_builtin - ("__cilk_spawn_or_continue", int_fun, BUILT_IN_SPAWN_OR_CONT, true); + ("cilk_spawn_or_continue", int_fun, BUILT_IN_SPAWN_OR_CONT, true); cilk_detach_begin_fndecl = install_builtin ("cilk_detach_begin", fptr_fun, BUILT_IN_CILK_DETACH_BEGIN, true); cilk_detach_end_fndecl = install_builtin ("cilk_detach_end", void_fun, @@ -799,7 +799,7 @@ get_zca_string_table_size (void) for (ii = 0; ii < length; ii++) { zca_entry = VEC_index (zca_data, zca_stack, ii); - str_length += strlen (zca_entry->string); + str_length += strlen (zca_entry->string) + 1 ; } return str_length; } @@ -838,7 +838,7 @@ output_zca_table (section *s) /* this outputs the offset to the string table */ assemble_integer (gen_rtx_CONST_INT (BLKmode, str_table_offset), 4, 1, 1); - str_table_offset += strlen (zca_entry->string); + str_table_offset += strlen (zca_entry->string) + 1; /* this outputs the offset to the annotation table */ assemble_integer (gen_rtx_CONST_INT (BLKmode, annotation_table_offset), @@ -861,10 +861,9 @@ output_string_table (section *s) { zca_entry = VEC_index (zca_data, zca_stack, ii); for (jj = 0; jj < (int)strlen (zca_entry->string); jj++) - { - assemble_integer (gen_rtx_CONST_INT (BLKmode, zca_entry->string[jj]), - 1, 1, 1); - } + assemble_integer (gen_rtx_CONST_INT (BLKmode, zca_entry->string[jj]), + 1, 1, 1); + assemble_integer (gen_rtx_CONST_INT (BLKmode, 0), 1, 1, 1); } return; } @@ -905,7 +904,7 @@ cilk_output_metadata (void) /* create a new zca section (if necessary) and switch to it */ s = get_unnamed_section (0, output_section_asm_op, - "\t.section .itt_notify_tab,\"aw\""); + "\t.section .itt_notify_tab,\"a\""); switch_to_section (s); assemble_align (BITS_PER_WORD); @@ -920,13 +919,13 @@ cilk_output_metadata (void) /* here we output the magic number */ for (ii = 0; ii < (int)strlen (itt_string); ii++) assemble_integer (gen_rtx_CONST_INT (BLKmode, itt_string[ii]), 1, 1, 1); - + assemble_integer (gen_rtx_CONST_INT (BLKmode, 0), 1, 1, 1); /* here we output the major and minor version number */ assemble_integer (gen_rtx_CONST_INT (BLKmode, ZCA_MAJOR_VER_NUMBER), 1, 1, 1); assemble_integer (gen_rtx_CONST_INT (BLKmode, ZCA_MINOR_VER_NUMBER), 1, 1, 1); entry_count = get_zca_entry_count (); - assemble_integer (gen_rtx_CONST_INT (BLKmode, entry_count), 4, 1, 1); + assemble_integer (gen_rtx_CONST_INT (BLKmode, entry_count), 2, 1, 1); /* now we output the offet to the string table. This is done by printing out * the label for string_table_start, then a '-' then start_label. The linker @@ -1003,13 +1002,13 @@ expand_builtin_cilk_metadata (const char *annotation ATTRIBUTE_UNUSED, gcc_assert (loc_ref); size = (unsigned short) size_of_locs (loc_ref); - metadata_info.dwarf_expr = (unsigned short)(size << 8) | - (unsigned short) (loc_ref->dw_loc_opc & 0xFF); + metadata_info.dwarf_expr = (unsigned short)(size & 0xFF) | + (unsigned short) (loc_ref->dw_loc_opc << 8); } else { /* this means we have no arguments */ - metadata_info.dwarf_expr = (1 << 8) | (DW_OP_lit0); + metadata_info.dwarf_expr = (1) | (DW_OP_lit0 << 8); } VEC_safe_push (zca_data, gc, zca_stack, &metadata_info); @@ -1083,10 +1082,8 @@ cilk_remove_annotated_functions (rtx first) } } } - for (ii = 0; ii < VEC_length (rtx, rtx_delete_list); ii++) - { - remove_insn (VEC_index (rtx, rtx_delete_list, ii)); - } + remove_insn (VEC_index (rtx, rtx_delete_list, ii)); + return; } diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4d4b2f9..91fc03a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20252,6 +20252,8 @@ dwarf2out_var_location (rtx loc_note) ca_loc->call_arg_loc_note = loc_note; ca_loc->next = NULL; ca_loc->label = last_label; + if (flag_enable_cilk) + return; gcc_assert (prev && (CALL_P (prev) || (NONJUMP_INSN_P (prev)