This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] recognize a 'not' of an assumed condition as false
ClosedPublic

Authored by spatel on Jan 9 2017, 2:36 PM.

Details

Summary

I think this is a logical extension of the current checks in computeKnownBitsFromAssume(). Ie, it has negligible cost for the added functionality. But let me know if we need to re-think the whole approach.

This is the reason I didn't have the canonical xor-form of 'not' in the test case for D28337 - it doesn't work without this change.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 83704.Jan 9 2017, 2:36 PM
spatel retitled this revision from to [ValueTracking] recognize a 'not' of an assumed condition as false.
spatel updated this object.
spatel added reviewers: efriedma, majnemer, hfinkel.
spatel added a subscriber: llvm-commits.
majnemer requested changes to this revision.Jan 9 2017, 3:14 PM
majnemer edited edge metadata.
majnemer added inline comments.
lib/Analysis/ValueTracking.cpp
550–551 ↗(On Diff #83704)

I don't think you want to use the uint64_t constructor here., you probably want to use clearAllBits and setAllBits on the two APInts as needed.

This revision now requires changes to proceed.Jan 9 2017, 3:14 PM
spatel updated this revision to Diff 83721.Jan 9 2017, 3:26 PM
spatel edited edge metadata.

Patch updated:
Use clearAllBits/setAllBits as suggested by David.

hfinkel accepted this revision.Jan 17 2017, 6:43 AM

LGTM

You'll also need a corresponding update to AssumptionCache::updateAffectedValues.

You'll also need a corresponding update to AssumptionCache::updateAffectedValues.

Thanks! I'll update that part, add the select test diff from D28337, and check it in.

This revision was automatically updated to reflect the committed changes.