This is similar to a 'nonnull' patch:
D27855
...that is still off by default because of C problems.
For this patch, the motivating case is shown in PR21780:
https://bugs.llvm.org/show_bug.cgi?id=21780
We are trying to preserve the ability of SLP (D64142) and/or the backend (D64205) to create a vector load even after some other pass like InstCombine has deleted scalar instructions by using demanded elements analysis. We do that by collecting all guaranteed accesses from a given pointer argument and creating a known dereferenceable byte range from those.
There's an alternate proposal to do something similar but more involved in:
D37579
...but that seems to have stalled.
And if I'm interpreting the comments there correctly, this is an implementation of a suggestion from @reames :
"...we can prove that the loads post dominate the entry to the function and could update the argument with the existing dereferenceability attribute. This might be an alternate approach and separately worth implementation."
Why not also stores (or AtomicCmpXchg or AtomicRMW)?