[libcxx-commits] [clang] [libcxx] [clang] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 27 04:40:15 PDT 2026


gonzalobg wrote:

Thanks, that clarifies it for me.

It seems like `clear_padding` is used to solve two different problems: 
- Implement `valueRepresentationEquals`: the goal of this function is to compare the non-padding bytes of an object.
  * How is this implemented today without `clear_padding`? (Do we just compare the padding bytes and fail more often?)
  * This sounds like it would benefit from being its own intrinsic to perform a byte-wise comparison of objects value representation (or to extract padding byte offsets, etc.). 
- performance tuning: increase the probability of CAS succeeding by keeping padding bytes zeroed in memory.

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


More information about the libcxx-commits mailing list