This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Consider assumptions in isKnownNonEqual
AbandonedPublic

Authored by marcauberer on Sep 2 2023, 5:14 AM.

Details

Summary

Consider icmp ne and icmp eq assumption intrinsic calls when checking
for known non-equality.

Diff Detail

Event Timeline

marcauberer created this revision.Sep 2 2023, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2023, 5:14 AM
marcauberer requested review of this revision.Sep 2 2023, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2023, 5:14 AM

Can you add some tests that show this in action?

jdoerfert added inline comments.Sep 5 2023, 11:51 AM
llvm/lib/Analysis/ValueTracking.cpp
3150

Equality check and Operand checks are probably faster than valid assume check.

marcauberer marked an inline comment as done.

Add tests and change order of checks

llvm/lib/Analysis/ValueTracking.cpp
3164

In generaly I'm not sure how valuable this is. Does it affect any of the codes in LLVM test suite or any common patterns?

llvm/test/Analysis/ValueTracking/known-non-equal.ll
1857

Can you pre-commit tests.
Also can you add some negative tests where the assume is 1) out of scope 2) doesn't actually imply equality, and 3) a case like if(X) { assume(X); ...(X) } else { ...(X) }.

marcauberer abandoned this revision.Sep 12 2023, 12:09 PM
marcauberer added inline comments.
llvm/lib/Analysis/ValueTracking.cpp
3164

The original use case vanished due to switching to a calculateKnownBits-approach.
So I think the relevant use cases are covered with calculateKnownBits, which is also refered by isKnownNonEqual for int and int vector types.