This is an archive of the discontinued LLVM Phabricator instance.

Cleanup: Merge isKnownNonNull into isKnownNonZero
ClosedPublic

Authored by nlopes on Sep 8 2017, 9:07 AM.

Details

Summary

This patch just copies the relevant bits from isKnownNonNull into isKnownNonZero and replaces all uses of isKnownNonNull with isKnownNonZero.

As a bonus, this patch fixes a bug that made isKnownNonNull consider that alloca always returns a non-null ptr with address space != 0.

Diff Detail

Repository
rL LLVM

Event Timeline

nlopes created this revision.Sep 8 2017, 9:07 AM
hfinkel accepted this revision.Sep 8 2017, 12:49 PM

LGTM

lib/Analysis/ValueTracking.cpp
1752 ↗(On Diff #114373)

Should we rename this also to be isKnownNonZeroFromDominatingCondition?

1849 ↗(On Diff #114373)

Indentation is off on this line.

This revision is now accepted and ready to land.Sep 8 2017, 12:49 PM
majnemer accepted this revision.Sep 8 2017, 1:01 PM

LGTM

This revision was automatically updated to reflect the committed changes.