[llvm] Add the 'initialized' attribute langref and support (PR #84803)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 14:43:41 PDT 2024


aeubanks wrote:

Even if we represent padding more precisely with multiple ranges in `initializes`, clang generates a `memset` of the entire alloca and DSE can only remove the part of the memset that corresponds to the first range and the last range, since it doesn't split memsets. So if we had one padding hole and used multiple ranges to represent everything else, we'd still end up with a store to the padding hole.

I think [`!tbaa.struct`](https://llvm.org/docs/LangRef.html#tbaa-struct-metadata) was designed for this, but [we don't emit it for `-ftrivial-auto-var-init`](https://godbolt.org/z/x1WWc5de8). Also it might not apply to `memset` right now, only `memcpy`?

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


More information about the llvm-commits mailing list