Every branch has two paths, the taken path and a fall through
path.
So if we assign one bit to each branch of a DAG, and update these bits
when we profile, the final binay number we get is an approximation
to the
path followed. If the hardware has a simple counter for predicting
or a
history register, then the bit updating is done for us by the hardware
and we need to just read the registers. In a way, this is similar to
assigning a unique number to each branch, but instead of the final
total being unique, we try to get a unique binary reprersentation for
each path. This method tries to take advantage of path profiling by
using existing branch predicting hardware. It would be interesting
to
see how this naive cost effective profiling compares with the other
methods
suggested in the papers.
Subramanian Rajagopalan