This patch makes uses of the context bridges introduced in D83299 to make
AAValueConstantRange call site specific.
I inspected the output that opt generates and it makes sense.
also the script's output (included in the patch) also makes sense the.
I will double check everything but this is weird.
File check fails to match the first check line.
Some minor comments below.
Upload diffs with full context please.
Can we split this in two statements for readability. Also use a C++ cast please. I think we can actually do cast on the AA and then getState() should give the right type. We might need to adjust the state wrapper return type though. Hope this makes some sense.
we should do this for the old and new PM, as well as the module and CGSCC pass.
LGTM with some comments to be addressed. This is cool :)
Nit: an 'argument'
This should not happen, right? Make it an assert instead.
We don't want the value here, do we. We want
const auto &AA = A.getAAFor<AAType>(QueryingAttribute, IRPosition::callsite_argument(*CBContext, ArgNo));
which might be better than the plain value result as it has a context instruction (and the attached attributes).
Use cast<..> and keep it as reference.