This adds the unknown_provenance LLVM-IR keyword, corresponding to the UnknownProvenance constant.
Diff Detail
Event Timeline
Please document this in the LLVM language reference! I for one have trouble following the discussions (since I didn't have the time to read all the C/C++ reports yet)
The general Full Restrict RFC is referenced to in D68484 (Pointed to by D104268, which introduces the ptr_provenance operand and provides the langref update).
The unknown_provenance (UnknownProvenance) constant is being introduced as a clean way to indicate that a ptr_provenance is unknown.
In the original full restrict proposal, this role was served by using undef (UndefValue) as ptr_provenance operand.
For full restrict that was ok, but when we want to use ptr_provenance in a broader context having a special value results in a cleaner implementation without ambiguity.
(Especially if, at a later time, we want to make use of ptr_provenance in BasicAliasAnalysis, not just ScopedNoAliasAA).
Should there be a verifier change to ensure that it is *actually* only used in the provenance operand, and not as a pure pointer,
or can it be PHI'd/select'ed from multiple variants?
Yes, that definitely makes sense.
It can be PHI'd, select'ed, cast'ed. But in the end, the usage must only show up in the provenance path of load,store,llvm.ptr.provenance.
I'll look into this in the coming days.
clang-format: please reformat the code
17 diff lines are omitted. See full path.