[PATCH] D128501: [CodeGen] Make uninitialized Lvalue bit-field stores poison compatible

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 18:25:46 PDT 2022


rjmccall added a comment.

In D128501#3613890 <https://reviews.llvm.org/D128501#3613890>, @efriedma wrote:

>> Is there no way in LLVM to load partially-initialized memory and then freeze it that will preserve the parts of the value that are initialized? Because that seems like something that LLVM needs to be providing.
>
> It's currently possible to `load <32 x i1>`, freeze the result, and bitcast it to i32.  But the backend is likely to turn that into something messy.  Otherwise, no, there isn't really any way to load a partially poisoned value as an i32.

Is that seen as a defect or as for some reason desirable?  Because I worry that optimizer people are talking themselves into something that would be a truly beautiful model if only there were a frontend that could emit code for it.

Doesn't this make it e.g. illegal to use large integer types to do a memcpy of anything that might contain uninitialized padding?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128501



More information about the cfe-commits mailing list