This patch adds a new transformation for propagating values used for indirect calls. The idea for this pass came from the review of D36432. The pass performs an IPSCCP-like analysis, propagating functions to indirect call sites and then attaching metadata to the call sites indicating the set of functions they may potentially target at run-time.
This metadata may be consumed by later transformations. My initial plan is to use the metadata to perform indirect call promotion for call sites that are known to target only two functions. The metadata can also be used, for example, to allow call sites to intersect the function attributes of the functions they are known to target (i.e., in CallSiteBase::hasFnAttr).
Although I've implemented this as a separate pass, the functionality could be added to IPSCCP without too much effort. I chose a separate pass primarily as an opportunity to revive the unused generic sparse propagation solver, but this isn't strictly necessary.
If patch sounds reasonable, please take a look at the dependent patches as well. D37354 adds the new kind of metadata, and D37353 enables the generic sparse propagation solver to work interprocedurally similar to IPSCCP. I've added a simple demonstration test to this patch, but I will add more if the overall approach looks good.
Is there a way we can avoid somewhat arbitrary cutoffs? They've been us a lot in the past.