@@ -120,6 +120,7 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "asan.h"
+#include "optinfo.h"
typedef fibonacci_heap <sreal, cgraph_edge> edge_heap_t;
typedef fibonacci_node <sreal, cgraph_edge> edge_heap_node_t;
@@ -250,6 +251,18 @@ report_inline_failed_reason (struct cgraph_edge *e)
(dump_file, 2, opts_for_fn (e->caller->decl),
opts_for_fn (e->callee->ultimate_alias_target ()->decl));
}
+ /* FIXME: partial re-implementation in terms of optinfo. */
+ if (optinfo_enabled_p ())
+ {
+ OPTINFO_FAILURE (e->call_stmt)
+ << "not inlinable: "
+ << e->caller
+ << " -> "
+ << e->callee
+ << ": "
+ << cgraph_inline_failed_string (e->inline_failed);
+ // FIXME: etc; see the option mismatch code above
+ }
}
/* Decide whether sanitizer-related attributes allow inlining. */
@@ -2167,6 +2180,12 @@ flatten_function (struct cgraph_node *node, bool early)
fprintf (dump_file, " Inlining %s into %s.\n",
xstrdup_for_dump (callee->name ()),
xstrdup_for_dump (e->caller->name ()));
+ if (optinfo_enabled_p ())
+ OPTINFO_SUCCESS (e->call_stmt)
+ << "inlining "
+ << callee
+ << " into "
+ << e->caller;
orig_callee = callee;
inline_call (e, true, NULL, NULL, false);
if (e->callee != orig_callee)
@@ -2677,6 +2696,12 @@ early_inline_small_functions (struct cgraph_node *node)
fprintf (dump_file, " Inlining %s into %s.\n",
xstrdup_for_dump (callee->name ()),
xstrdup_for_dump (e->caller->name ()));
+ if (optinfo_enabled_p ())
+ OPTINFO_SUCCESS (e->call_stmt)
+ << "inlining "
+ << callee
+ << " into "
+ << e->caller;
inline_call (e, true, NULL, NULL, false);
inlined = true;
}
@@ -61,6 +61,7 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "sreal.h"
+#include "optinfo.h"
/* I'm not real happy about this, but we need to handle gimple and
non-gimple trees. */
@@ -4719,6 +4720,15 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
id->src_node->dump (dump_file);
id->dst_node->dump (dump_file);
}
+ /* FIXME. */
+ if (optinfo_enabled_p ())
+ OPTINFO_SUCCESS(call_stmt)
+ << "Inlining "
+ << id->src_node
+ << " to "
+ << id->dst_node
+ << optinfo_printf (" with frequency %4.2f",
+ cg_edge->sreal_frequency ().to_double ());
/* This is it. Duplicate the callee body. Assume callee is
pre-gimplified. Note that we must not alter the caller