[PATCH] D87974: [Builtin] Add __builtin_zero_non_value_bits.

Miya Natsuhara via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 11 15:45:15 PST 2020


mnatsuhara added a comment.

After following up with the team responsible for `__builtin_zero_non_value_bits` on MSVC, I have some more information to offer in conjunction with @BillyONeal's report:

- For unions, we always assume that it has unique object representations and thus does not have any padding bytes.  This allows `__builtin_zero_non_value_bits` to be used with types with union members, not always accurately but never destructively.  (If the union has padding bytes, we don't know which member is active so we don't know exactly where the padding bytes are.  To return padding bytes assuming any member risks changing the value.)
- Our implementation does appear to include tail padding and this would include any such padding that is due to alignment requirements, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87974



More information about the cfe-commits mailing list