summaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorspark <spark@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-28 20:15:10 +0000
committerspark <spark@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-28 20:15:10 +0000
commit69eee21db577b8a270fae4da3cc5f8686ca93057 (patch)
treeeec1f0a98236b0cc50a93f03ae95201e815b992a /gcc/value-prof.c
parente8a6d961f10be0350c17bfc3cd7e843c6d444812 (diff)
downloadgcc-69eee21db577b8a270fae4da3cc5f8686ca93057.tar.gz
2008-05-28 Seongbae Park <seongbae.park@gmail.com>
* tree-ssa-propagate.c (set_rhs): Preserve the histogram and the eh region information. * value-prof.c (gimple_move_stmt_histograms): New function. * value-prof.h (gimple_move_stmt_histograms): New function declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136124 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 8b0087a850f..61b0a0773a2 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -336,6 +336,25 @@ gimple_duplicate_stmt_histograms (struct function *fun, tree stmt,
}
}
+
+/* Move all histograms associated with OSTMT to STMT. */
+
+void
+gimple_move_stmt_histograms (struct function *fun, tree stmt, tree ostmt)
+{
+ histogram_value val = gimple_histogram_value (fun, ostmt);
+ if (val)
+ {
+ /* The following three statements can't be reordered,
+ because histogram hashtab relies on stmt field value
+ for finding the exact slot. */
+ set_histogram_value (fun, ostmt, NULL);
+ for (; val != NULL; val = val->hvalue.next)
+ val->hvalue.stmt = stmt;
+ set_histogram_value (fun, stmt, val);
+ }
+}
+
static bool error_found = false;
/* Helper function for verify_histograms. For each histogram reachable via htab