Some function attributes imply the attribute for all/some instructions
in the function. These attributes can be safely propagated to
callsites within the function that are missing the attribute. This can
be useful if the original caller is later inlined, as if the
attributes are not propagated, they will be lost.
This patch only implements the attributes can can be blindly propagated.
- mustprogress, willreturn
If any of the above are true for the function, they MUST apply to any
callsite in the function (along with any other instruction).
Function access attributes:
- readonly, readnone, writeonly
These can be applied to a callsite if all the callsite arguments'
underlying objects are globals or arguments to the caller. In this
case, since the callsite has the same visible pointer set as the
caller, the gurantees map 1-1.
- noundef, nonnull, nofree, readonly, readnone, writeonly
If any of the above are true for an argument to the caller it will
hold true as an argument for the callsite.
- noundef, nonnull
IFF the callsite's value is used as the caller's return value, we can
propagate those attributes.