From cTuning.org

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
* [http://groups.google.com/group/ctuning-discussions cTuning development mailing list]
* [http://groups.google.com/group/ctuning-discussions cTuning development mailing list]
-
== Function cloning work flow ==
 
 +
== Key data structures ==
-
== Instrumentation work flow ==
 
 +
== Function cloning ==
-
== ICI Adaptation work flow ==
+
=== Description ==
 +
SIMPLE_IPA_PASS "generic_cloning"
 +
This pass performs generic function cloning. It has the ability to create any number of clones for a given function on demand, and aply different fine-grain optimizations for a given clone, also provide mechanism to select different clones at run-time based on optimization scenarios. It can be triggered by GCC option -fapi-clone-function and ICI adaptation framework. The information come from xml files through ICI.
 +
'''Primary functions'''
 +
exec_clone_functions (void)
 +
add_call_to_clones (struct cgraph_node *orig, int nid)
 +
get_arguments (tree tree_list)
 +
parse_arguments (char *text, unsigned int *argc)
 +
find_clone_options (char *funcname, int *nid)
 +
is_in_clone_list (const char *func_name, const char *file_name, int *nid)
 +
freecloneinfo (cloneinfo cdi)
 +
is_it_clonable (struct cgraph_node *cg_func)
 +
is_it_main (struct cgraph_node *cg_func)
 +
=== Work flow ==
-
== Key data structures ==
+
== Instrumentation ==
 +
 
 +
=== Description ==
 +
SIMPLE_IPA_PASS "Instrumentation"
 +
This pass performs function instrumentation. Currently, it has only ability to  add function calls and selection mechanism to choose clones based on the external library monitoring routines. We also have the ability to link external libraries transparently withou Makefile modifications. This pass also can be triggered by GCC option fapi-instrument-functions and ICI adaptation framework. The information come from xml files through ICI.
 +
'''Primary functions'''
 +
exec_instrument_functions (void)
 +
add_timer_begin (struct cgraph_node *cg_func, char *funname, int cloned)
 +
add_timer_end (struct cgraph_node *cg_func, char *funname)
 +
freeinstrinfo (instrinfo idi)
 +
is_in_instrument_list (const char *func_name, const char *file_name, int *nid)
 +
is_it_instrumentable (struct cgraph_node *cg_func)
 +
 
 +
=== Work flow ===
 +
 
 +
== ICI Adaptation work flow ==
== New ICI event ==
== New ICI event ==
 +
ICI event "load_instr_config"
 +
Call this event at the very beginning of function cloning pass.
 +
Call back function: load_clone_config ()
 +
ICI event “load_clone_config”
 +
Call this event at the very beginning of function instrumentation pass.
 +
Call back function : load_instr_config ()

Revision as of 08:28, 11 August 2009

Google Summer of Code 2009: Generic function cloning.

Liang Peng

Based on Run-time Function Adaptation for Statically-Compiled Programs based on function multiversioning and FunctionSpecificOpt, we enabled generic function cloning with low-overhead program behavior monitoring routines. It will enable fine-grain self-tuning binaries and libraries and will increase performance and portability of the static code which is particularly important for rapidly evolving hardware and virtual enviroments.


Contents

Key data structures

Function cloning

= Description

SIMPLE_IPA_PASS "generic_cloning" This pass performs generic function cloning. It has the ability to create any number of clones for a given function on demand, and aply different fine-grain optimizations for a given clone, also provide mechanism to select different clones at run-time based on optimization scenarios. It can be triggered by GCC option -fapi-clone-function and ICI adaptation framework. The information come from xml files through ICI. Primary functions exec_clone_functions (void) add_call_to_clones (struct cgraph_node *orig, int nid) get_arguments (tree tree_list) parse_arguments (char *text, unsigned int *argc) find_clone_options (char *funcname, int *nid) is_in_clone_list (const char *func_name, const char *file_name, int *nid) freecloneinfo (cloneinfo cdi) is_it_clonable (struct cgraph_node *cg_func) is_it_main (struct cgraph_node *cg_func)

= Work flow

Instrumentation

= Description

SIMPLE_IPA_PASS "Instrumentation" This pass performs function instrumentation. Currently, it has only ability to add function calls and selection mechanism to choose clones based on the external library monitoring routines. We also have the ability to link external libraries transparently withou Makefile modifications. This pass also can be triggered by GCC option fapi-instrument-functions and ICI adaptation framework. The information come from xml files through ICI. Primary functions exec_instrument_functions (void) add_timer_begin (struct cgraph_node *cg_func, char *funname, int cloned) add_timer_end (struct cgraph_node *cg_func, char *funname) freeinstrinfo (instrinfo idi) is_in_instrument_list (const char *func_name, const char *file_name, int *nid) is_it_instrumentable (struct cgraph_node *cg_func)

Work flow

ICI Adaptation work flow

New ICI event

ICI event "load_instr_config" Call this event at the very beginning of function cloning pass. Call back function: load_clone_config () ICI event “load_clone_config” Call this event at the very beginning of function instrumentation pass. Call back function : load_instr_config ()

Locations of visitors to this page