A GEP inbounds cannot return a null pointer in address space 0 because:
- the input is non-zero
- arithmetic cannot overflow
This patch makes isKnownNonNull() recognize this fact.
Differential D35887
isKnownNonNull: recognize GEP inbounds as non-null nlopes on Jul 26 2017, 5:54 AM. Authored by
Details
A GEP inbounds cannot return a null pointer in address space 0 because:
This patch makes isKnownNonNull() recognize this fact.
Diff Detail
Event TimelineComment Actions Just realized there's a complicated isGEPKnownNonNull() in ValueTracking.cpp, which is use solely by isKnownNonZero(). Comment Actions Ah, thanks for the pointer. Comment Actions isKnownNonZero was added in r124183; isKnownNonNull was originally part of BasicAA, then moved in r151446. |