This is a patch to LangRef suggesting that pointers tothat clarifies the behavior of load/store should be
well-defined, and/memset/memcpy/memmove when the size of memset/memcpy/memmove should bepointers or sizes are not well-defined
If the size is non-zero, mem*'s pointers should be well-defined as well.
This means that, for example, it is undefined behavior to do
%p = alloca [8 x i8]
%p2 = gep %p, (undef & 7)
store 0, %p2
even if `undef & 7` is always less than 8.
This patch is beneficial for further no-undef analysis.
IIUC, this is consistent with MSan's assumption.
With `-msan-check-access-address` enabled,
itMSan detects a case when e.g., only lower bits of address are garbage.
A remaining concern is whether there exists a case that this undef-bits offset
I'll send a mail to llvm-dev for further discussion when `-msan-check-access-address` is enabled, and it does not directly conflict with this patch because a C program should not use a pointer with undef bits and reasonable optimizations do not convert a well-defined pointer into a pointer with undef bits.
BTW, tThis patch contains slightly more diff that moves a a definition of a well-definition of frozened value as well.
value to the end of poison part and etc.