In the feedback in D51650 (https://reviews.llvm.org/D51650),
@rsmith points out an implementation detail of CPU-Dispatch
is improperly done. I'd like to fix this here before rebasing
target_clones on the patch resulting from this feedback.
This is a first-run at making the GlobalDecl contain the index
of the multiversion version.
The other suggestion @rsmith made was to make getting the MV-type
more streamlined. I've been thinking of ways to do that, and will
likely attempt to fix it before target_clones goes in with a rebase.
There are two big points of feedback that I'd really appreciate:
1- I suspect that something serious needs to be done on GlobalDecl.
It currently holds a 2 bit value in a PointerIntPair, which obviously
won't work for the index. I added an unsigned, but am open to
suggestions on how to store this better.
2- CodeGenModule::getFunctionFeatureMap takes a FunctionDecl, but the
features are dependent on the GlobalDecl now. I traced usages upwards,
and many cases don't have GlobalDecl in its call-tree (since it comes
from a callee). I'm not sure it matters, since only the emit-call should
require this info, but any suggestions are greatly appreciated.