[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

A. Jiang via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 17:16:54 PDT 2024


frederick-vs-ja wrote:

> This does something both useful and correct with `-fno-strict-aliasing`.

I'm not sure whether an instrinsic is even needed with `-fno-strict-aliasing`. IIUC `std::start_lifetime_as` mainly tells the compiler that the types of data in the storage can be changed (indeterminately) with the object representations unchanged. This behaves like some fence for TBAA.

> we can now observe them and use them to validate e.g. the `llvm.tbaa.fence` proposal.

Yeah. I guess we need to implement `std::start_lifetime_as(_array)` with `llvm.tbaa.fence`.

https://github.com/llvm/llvm-project/pull/82776


More information about the cfe-commits mailing list