summaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 11:37:52 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 11:37:52 +0000
commitc272d6a360d7bb873c18a01c75eda2d63616ee92 (patch)
treeccf30967b64909fbd1caf38b5e2c68a7e4788148 /gcc/value-prof.c
parenta94cf2cfcc65e72da92c298e5b13242abeb95feb (diff)
downloadgcc-c272d6a360d7bb873c18a01c75eda2d63616ee92.tar.gz
PR target/17428
* cfgrtl.c (safe_insert_insn_on_edge): Avoid extending life range of hard registers. * value-prof.c (insn_prefetch_values_to_profile): Only scan normal insns. * value-prof.c (rtl_find_values_to_profile): Do not look for values to profile in libcalls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 1663e64800d..e5e43206b40 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -245,7 +245,8 @@ insn_prefetch_values_to_profile (rtx insn, histogram_values *values)
int write;
histogram_value hist;
- if (!INSN_P (insn))
+ /* It only makes sense to look for memory references in ordinary insns. */
+ if (GET_CODE (insn) != INSN)
return false;
if (!find_mem_reference (insn, &mem, &write))
@@ -288,13 +289,30 @@ static void
rtl_find_values_to_profile (histogram_values *values)
{
rtx insn;
- unsigned i;
+ unsigned i, libcall_level;
life_analysis (NULL, PROP_DEATH_NOTES);
*values = VEC_alloc (histogram_value, 0);
+ libcall_level = 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- insn_values_to_profile (insn, values);
+ {
+ if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+ libcall_level++;
+
+ /* Do not instrument values inside libcalls (we are going to split block
+ due to instrumentation, and libcall blocks should be local to a single
+ basic block). */
+ if (!libcall_level)
+ insn_values_to_profile (insn, values);
+
+ if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
+ {
+ gcc_assert (libcall_level > 0);
+ libcall_level--;
+ }
+ }
+ gcc_assert (libcall_level == 0);
for (i = 0; i < VEC_length (histogram_value, *values); i++)
{