From b608a1bc71edb6b778407dd9bfdf0cbd6bcb4c1b Mon Sep 17 00:00:00 2001 From: Seongbae Park Date: Wed, 28 May 2008 20:15:10 +0000 Subject: tree-ssa-propagate.c (set_rhs): Preserve the histogram and the eh region information. 2008-05-28 Seongbae Park * 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. From-SVN: r136124 --- gcc/value-prof.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/value-prof.c') diff --git a/gcc/value-prof.c b/gcc/value-prof.c index 8b0087a..61b0a07 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 -- cgit v1.1