mirror of git://gcc.gnu.org/git/gcc.git
Give proper type and size to named cold partitions.
2015-04-27 Caroline Tice <cmtice@google.com> * final.c (final_scan_insn): Output cold_function_nmae as function type. * varasm.c (cold_function_name): Make gloval. (assemble_start_function): Re-set cold_function_name. (assemble_end_function): Output cold partition size. * varasm.h (cold_fun ction_name): Declare global. 2015-04-27 Caroline Tice <cmtice@google.com> * gcc.dg/tree-prof/cold_partition_label.c (main): Check for cold partition size. From-SVN: r222473
This commit is contained in:
parent
0a48088a0b
commit
16d710b164
|
|
@ -1,3 +1,12 @@
|
||||||
|
2015-04-27 Caroline Tice <cmtice@google.com>
|
||||||
|
|
||||||
|
* final.c (final_scan_insn): Output cold_function_nmae as function
|
||||||
|
type.
|
||||||
|
* varasm.c (cold_function_name): Make gloval.
|
||||||
|
(assemble_start_function): Re-set cold_function_name.
|
||||||
|
(assemble_end_function): Output cold partition size.
|
||||||
|
* varasm.h (cold_fun ction_name): Declare global.
|
||||||
|
|
||||||
2015-04-27 Ilya Tocar <ilya.tocar@intel.com>
|
2015-04-27 Ilya Tocar <ilya.tocar@intel.com>
|
||||||
|
|
||||||
* config/i386/i386.h (EXT_REX_SSE_REG_P): New.
|
* config/i386/i386.h (EXT_REX_SSE_REG_P): New.
|
||||||
|
|
|
||||||
|
|
@ -2233,10 +2233,16 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
|
||||||
suffixing "cold" to the original function's name. */
|
suffixing "cold" to the original function's name. */
|
||||||
if (in_cold_section_p)
|
if (in_cold_section_p)
|
||||||
{
|
{
|
||||||
tree cold_function_name
|
cold_function_name
|
||||||
= clone_function_name (current_function_decl, "cold");
|
= clone_function_name (current_function_decl, "cold");
|
||||||
|
#ifdef ASM_DECLARE_FUNCTION_NAME
|
||||||
|
ASM_DECLARE_FUNCTION_NAME (asm_out_file,
|
||||||
|
IDENTIFIER_POINTER (cold_function_name),
|
||||||
|
current_function_decl);
|
||||||
|
#else
|
||||||
ASM_OUTPUT_LABEL (asm_out_file,
|
ASM_OUTPUT_LABEL (asm_out_file,
|
||||||
IDENTIFIER_POINTER (cold_function_name));
|
IDENTIFIER_POINTER (cold_function_name));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-04-27 Caroline Tice <cmtice@google.com>
|
||||||
|
|
||||||
|
* gcc.dg/tree-prof/cold_partition_label.c (main): Check for cold
|
||||||
|
partition size.
|
||||||
|
|
||||||
2015-04-27 Peter Bergner <bergner@vnet.ibm.com>
|
2015-04-27 Peter Bergner <bergner@vnet.ibm.com>
|
||||||
|
|
||||||
PR target/64579
|
PR target/64579
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,6 @@ main (int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* { dg-final-use { scan-assembler "foo\[._\]+cold\[\._\]+0" } } */
|
||||||
|
/* { dg-final-use { scan-assembler "size\[ \ta-zA-Z0-0\]+foo\[._\]+cold\[\._\]+0" } } */
|
||||||
/* { dg-final-use { cleanup-saved-temps } } */
|
/* { dg-final-use { cleanup-saved-temps } } */
|
||||||
|
|
|
||||||
12
gcc/varasm.c
12
gcc/varasm.c
|
|
@ -187,6 +187,13 @@ section *in_section;
|
||||||
at the cold section. */
|
at the cold section. */
|
||||||
bool in_cold_section_p;
|
bool in_cold_section_p;
|
||||||
|
|
||||||
|
/* The following global holds the "function name" for the code in the
|
||||||
|
cold section of a function, if hot/cold function splitting is enabled
|
||||||
|
and there was actually code that went into the cold section. A
|
||||||
|
pseudo function name is needed for the cold section of code for some
|
||||||
|
debugging tools that perform symbolization. */
|
||||||
|
tree cold_function_name = NULL_TREE;
|
||||||
|
|
||||||
/* A linked list of all the unnamed sections. */
|
/* A linked list of all the unnamed sections. */
|
||||||
static GTY(()) section *unnamed_sections;
|
static GTY(()) section *unnamed_sections;
|
||||||
|
|
||||||
|
|
@ -1719,6 +1726,7 @@ assemble_start_function (tree decl, const char *fnname)
|
||||||
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDE", const_labelno);
|
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDE", const_labelno);
|
||||||
crtl->subsections.cold_section_end_label = ggc_strdup (tmp_label);
|
crtl->subsections.cold_section_end_label = ggc_strdup (tmp_label);
|
||||||
const_labelno++;
|
const_labelno++;
|
||||||
|
cold_function_name = NULL_TREE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1856,6 +1864,10 @@ assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED)
|
||||||
|
|
||||||
save_text_section = in_section;
|
save_text_section = in_section;
|
||||||
switch_to_section (unlikely_text_section ());
|
switch_to_section (unlikely_text_section ());
|
||||||
|
if (cold_function_name != NULL_TREE)
|
||||||
|
ASM_DECLARE_FUNCTION_SIZE (asm_out_file,
|
||||||
|
IDENTIFIER_POINTER (cold_function_name),
|
||||||
|
decl);
|
||||||
ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_end_label);
|
ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_end_label);
|
||||||
if (first_function_block_is_cold)
|
if (first_function_block_is_cold)
|
||||||
switch_to_section (text_section);
|
switch_to_section (text_section);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,13 @@ along with GCC; see the file COPYING3. If not see
|
||||||
#ifndef GCC_VARASM_H
|
#ifndef GCC_VARASM_H
|
||||||
#define GCC_VARASM_H
|
#define GCC_VARASM_H
|
||||||
|
|
||||||
|
/* The following global holds the "function name" for the code in the
|
||||||
|
cold section of a function, if hot/cold function splitting is enabled
|
||||||
|
and there was actually code that went into the cold section. A
|
||||||
|
pseudo function name is needed for the cold section of code for some
|
||||||
|
debugging tools that perform symbolization. */
|
||||||
|
extern tree cold_function_name;
|
||||||
|
|
||||||
extern tree tree_output_constant_def (tree);
|
extern tree tree_output_constant_def (tree);
|
||||||
extern void make_decl_rtl (tree);
|
extern void make_decl_rtl (tree);
|
||||||
extern rtx make_decl_rtl_for_debug (tree);
|
extern rtx make_decl_rtl_for_debug (tree);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue