This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking][NFC] Split off computeKnownBitsFromCmp from computeKnownBitsFromAssume
ClosedPublic

Authored by mkazantsev on May 5 2023, 1:48 AM.

Details

Summary

Separate the part which is specific for assume intrinsic from the part which only requires an icmp,
so that the latter could be reused for other purposes (e.g. in dominating conditions).

Diff Detail

Event Timeline

mkazantsev created this revision.May 5 2023, 1:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:49 AM
mkazantsev requested review of this revision.May 5 2023, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 1:49 AM
nikic accepted this revision.May 5 2023, 2:11 AM

LGTM

This revision is now accepted and ready to land.May 5 2023, 2:11 AM
This revision was landed with ongoing or failed builds.May 5 2023, 3:04 AM
This revision was automatically updated to reflect the committed changes.
cmtice added a subscriber: cmtice.May 5 2023, 1:14 PM

This change causes build failures for builds that eliminate asserts:

llvm-project/llvm/lib/Analysis/ValueTracking.cpp:895:12: error: unused variable 'BitWidth' [-Werror,-Wunused-variable]

unsigned BitWidth = Known.getBitWidth();
         ^

1 error generated.

(After your commit, BitWidth is only used in assert statements).

cmtice added a comment.May 5 2023, 2:08 PM

Never mind; I seem to have gotten a bad download. Please forgive the noise.