Currently when printing VPValues we use the object address, which makes
it hard to distinguish VPValues as they usually are large numbers with
varying distance between them.
This patch adds a simple slot tracker, similar to the ModuleSlotTracker
used for IR values. In order to dump a VPValue or anything containing a
VPValue, a slot tracker for the enclosing VPlan needs to be created. The
existing VPlanPrinter can take care of that for the existing code. We
assign consecutive numbers to each VPValue we encounter in a reverse
post order traversal of the VPlan.
The drawback is that the slot tracker is also required to print a single
instruction and needs to be passed in, as currently neither instructions
nor VPBlockBase has a reference to the containing plan. To address this,
I think we should add a reference to the containing VPlan to VPBlockBase
and use that to provide print functions and operator<< without needing
to pass in a slot tracker. What do you think?
It seems all derived recipes have the same implementation for this method, i.e. create a SlotTracker and pass it to the actually-printing variant below. Does it still need to be virtual?