aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2014-05-20 20:12:22 +0000
committerXinliang David Li <davidxl@gcc.gnu.org>2014-05-20 20:12:22 +0000
commit2b5f08952775ead634c0020b2dcf9523414c8752 (patch)
tree01587269ffd956843f503c973e2d46f9e33e8016 /gcc/cgraphunit.c
parent9c5f620306f1a53d0d0c5d75e77bd9c6af1e6cd1 (diff)
downloadgcc-2b5f08952775ead634c0020b2dcf9523414c8752.zip
gcc-2b5f08952775ead634c0020b2dcf9523414c8752.tar.gz
gcc-2b5f08952775ead634c0020b2dcf9523414c8752.tar.bz2
add dbgcnt support for devirt
From-SVN: r210657
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index f5d9594..4084cc4 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -210,6 +210,7 @@ along with GCC; see the file COPYING3. If not see
#include "pass_manager.h"
#include "tree-nested.h"
#include "gimplify.h"
+#include "dbgcnt.h"
/* Queue of cgraph nodes scheduled to be added into cgraph. This is a
secondary queue used during optimization to accommodate passes that
@@ -886,7 +887,7 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
make the edge direct. */
if (final)
{
- if (targets.length () <= 1)
+ if (targets.length () <= 1 && dbg_cnt (devirt))
{
cgraph_node *target;
if (targets.length () == 1)
@@ -903,6 +904,14 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
edge->call_stmt, 0,
TDF_SLIM);
}
+ if (dump_enabled_p ())
+ {
+ location_t locus = gimple_location (edge->call_stmt);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, locus,
+ "devirtualizing call in %s to %s\n",
+ edge->caller->name (), target->name ());
+ }
+
cgraph_make_edge_direct (edge, target);
cgraph_redirect_edge_call_stmt_to_callee (edge);
if (cgraph_dump_file)