This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Add helper for handling `computeKnownBits` for and/xor/or; NFC
ClosedPublic

Authored by goldstein.w.n on Jan 29 2023, 2:09 PM.

Details

Summary

This change just factors out the existing logic for and/xor/or and
puts them in a publicly available helper. functionality is the same.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 29 2023, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2023, 2:09 PM
goldstein.w.n requested review of this revision.Jan 29 2023, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2023, 2:09 PM
nikic added inline comments.Feb 18 2023, 11:59 AM
llvm/lib/Analysis/ValueTracking.cpp
1071

I don't understand this comment.

1087

clearing -> clear?

1100

It doesn't look like the and/xor cases here really share any code -- makes more sense to handle them in separate ifs ... or better, move them into the respective switch cases above?

goldstein.w.n marked 3 inline comments as done.Feb 18 2023, 12:28 PM
goldstein.w.n added inline comments.
llvm/lib/Analysis/ValueTracking.cpp
1071

I don't understand this comment.

Sorry, is outdated now that KnownOut is a seperate variable than KnownLHS. Removed.

goldstein.w.n marked an inline comment as done.

Fix some nits + reorganize and/xor case

nikic accepted this revision.Feb 18 2023, 12:50 PM

LGTM

This revision is now accepted and ready to land.Feb 18 2023, 12:50 PM
This revision was landed with ongoing or failed builds.Feb 23 2023, 5:52 PM
This revision was automatically updated to reflect the committed changes.