There is currently no way to mimic this, the original idea would have been
that you record the per stmt info during add_stmt cost hook time and then
process that data at finish_cost time.
With SLP you could in theory walk the SLP graph via the instances vector of
the vinfo. But I’m not sure what exactly you compute at the moment and how
that even makes sense with SLP in mind. You can of course compute register
pressure of the original scalar code, but that doesn’t seem like what you are
doing.
Although the heuristic would need more rework to be "SLP first" I think we can
get away with a hash_map that stores the necessary information, at least for
the time being. Currently testing a local workaround.
--
Regards
Robin