[llvm-dev] [cfe-dev] Demystifying the byte type

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 18 21:59:43 PDT 2021

>From the linked document:

> Solution 3: Annotations and tags
> LLVM optimizers work with the assumption that attributes can be discarded if the optimizer does not know how to handle them.

I don't think this is necessarily the case. Such attributes can be
designed such that a missing attribute represents the most
conservative, like the `mustprogress` attribute/metadata. That is, a
missing annotation has an implicit provenance of {all}. GVN can fold q
and p after `if (q == p)` with a new provenance being the union of q
and p's provenance, like a PHINode. In other models, p and q cannot be
folded or in the case of the proposed byte type, cannot carry
provenance information.

> High engineering effort to enforce that attributes are preserved in every transformation and used by analyses.

IMHO, it is still lower than introducing a new first-class type.


More information about the llvm-dev mailing list