Extract a part of isDereferenceableAndAlignedPointer functionality to Value::getPointerDerferecnceableBytes. Currently it's a NFC, but in future I'm going to accumulate all the logic about value dereferenceability in this function similarly to Value::getPointerAlignment function (D16144).
LGTM w/minor comment addressed.
|507 ↗||(On Diff #48937)|
This part of the comment is unclear. Can you reword?
|522 ↗||(On Diff #48937)|
As a separate patch, I think it would make sense to just kill the CanBeNull bit entirely. The cases where we can not check for null are also ones isKnownNonNull can trivially return true for.