+ Value profiling internals
+ ==========================
+
+ Every value profiling transformation starts with defining what values
+ to profile. There are different histogram types (see HIST_TYPE_* in
+ value-prof.h) and each transformation can request one or more histogram
+ types per GIMPLE statement. The function gimple_find_values_to_profile()
+ collects the values to profile in a vec, and adds the number of counters
+ required for the different histogram types.
+
+ For a -fprofile-generate run, the statements for which values should be
+ recorded, are instrumented in instrument_values(). The instrumentation
+ is done by helper functions that can be found in tree-profile.c, where
+ new types of histograms can be added if necessary.
+
+ After a -fprofile-use, the value profiling data is read back in by
+ compute_value_histograms() that translates the collected data to
+ histograms and attaches them to the profiled statements via
+ gimple_add_histogram_value(). Histograms are stored in a hash table
+ that is attached to every intrumented function, see VALUE_HISTOGRAMS
+ in function.h.
+
+ The value-profile transformations driver is the function
+ gimple_value_profile_transformations(). It traverses all statements in
+ the to-be-transformed function, and looks for statements with one or
+ more histograms attached to it. If a statement has histograms, the
+ transformation functions are called on the statement.
+
+ Limitations / FIXME / TODO:
+ * Only one histogram of each type can be associated with a statement.
+ * Currently, HIST_TYPE_CONST_DELTA is not implemented.
+ (This type of histogram was originally used to implement a form of
+ stride profiling based speculative prefetching to improve SPEC2000
+ scores for memory-bound benchmarks, mcf and equake. However, this
+ was an RTL value-profiling transformation, and those have all been
+ removed.)
+ * Some value profile transformations are done in builtins.c (?!)
+ * Updating of histograms needs some TLC.
+ * The value profiling code could be used to record analysis results
+ from non-profiling (e.g. VRP).
+ * Adding new profilers should be simplified, starting with a cleanup
+ of what-happens-where andwith making gimple_find_values_to_profile
+ and gimple_value_profile_transformations table-driven, perhaps...
+*/