This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Add logic for `isKnownNonZero(ctlz/cttz X)`
ClosedPublic

Authored by goldstein.w.n on Apr 27 2023, 11:19 PM.

Details

Summary

for cttz if X[0] is non-zero, then the expression is non-zero.
for ctlz if X[SignBit] is non-zero, then the expression in
non-zero.

Alive2 Links:

cttz (false): https://alive2.llvm.org/ce/z/ySQzbg
cttz (true): https://alive2.llvm.org/ce/z/auiTCJ
ctlz (false): https://alive2.llvm.org/ce/z/yk3sTJ
ctlz (true): https://alive2.llvm.org/ce/z/-JuDty

Diff Detail

Event Timeline

goldstein.w.n created this revision.Apr 27 2023, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 11:19 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
goldstein.w.n requested review of this revision.Apr 27 2023, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 11:19 PM
nikic accepted this revision.Apr 28 2023, 1:33 AM

LGTM

This revision is now accepted and ready to land.Apr 28 2023, 1:33 AM
This revision was landed with ongoing or failed builds.Apr 30 2023, 8:07 AM
This revision was automatically updated to reflect the committed changes.