This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Use predicates for incoming phi-edges to deduce non-zero
ClosedPublic

Authored by goldstein.w.n on Aug 12 2023, 2:43 PM.

Details

Summary

This is basically a copy and paste of the same logic we do in
computeKnownBits but adapts it for just isKnownNonZero.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Aug 12 2023, 2:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2023, 2:43 PM
goldstein.w.n requested review of this revision.Aug 12 2023, 2:43 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nikic accepted this revision.Aug 13 2023, 1:02 AM

LGTM

llvm/lib/Analysis/ValueTracking.cpp
2685

if (TrueSucc != FalseSucc) would be less confusing, I think?

llvm/test/Transforms/JumpThreading/phi-known.ll
2

Please pre-commit regenerating this test with UTC.

This revision is now accepted and ready to land.Aug 13 2023, 1:02 AM
goldstein.w.n marked an inline comment as done.Aug 13 2023, 10:30 AM
goldstein.w.n added inline comments.
llvm/lib/Analysis/ValueTracking.cpp
2685

This is cut/paste from the knownbits codes. Would rather just add NFC follow up to both of these two update to less confusing logic (and will do so unless you object).

Rebase ontop of jump threading NFC