Adds computation of the classic reuse distance (or "stack distance") for each cache line reference under the -reuse_distance tool. Stores the distances in a histogram. Reports the mean, median, and standard deviation by default, and on request via -reuse_distance_histogram prints the full histogram with percentages and cumulative percentages.
The distance is computed with reasonable overhead using a one-layer skip list where each node stores the distance from the head. The skip distance is controlled by -reuse_skip_dist and should be kept close to the average reuse distance, but here we rely on the user setting it and use a reasonable default.
Includes a debug-build option -reuse_verify_skip to verify the skip list results by performing a full walk, and debug-build list printing and diagnostics.
Updates the tool.reuse test and adds a new tool.reuse.offline test that uses a new checked-in trace file to test precise numeric stats and histogram results.
Fixes #2300 (closed)