[PATCH] D104270: [ptr_provenance] Bitcode reader/writer support for the optional ptr_provenance operand of load/store instructions

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 07:51:26 PST 2022


jeroen.dobbelaere added a comment.

In D104270#3883808 <https://reviews.llvm.org/D104270#3883808>, @jdoerfert wrote:

> Why do we add the boolean, isn't a nullptr/unknown provenance just as good?

(I misinterpreted this as pushing an actual '0 pointer' to indicate that the ptr_provenance is not used. As far as I see, that is not possible.)
The boolean is to indicate that we do (or do not) have the optional ptr_provenance. It allows us to add more arguments to these instructions later (if that would be needed).
Just depending on the 'number of arguments' would not be sufficient here. So this is for forwards compatibility.

A `nullptr`, or `unknown_provenance` have their own meaning in the ptr_provenance world. At this point, a missing ptr_provenance argument indicates that the provenance is that of the pointer argument.
At a later time we can decide to move to a mechanism that the ptr_provenance should always be present and then the 'unknown_provenance' would be the best choice if its was missing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104270/new/

https://reviews.llvm.org/D104270



More information about the llvm-commits mailing list