[PATCH] D98422: [Alias] Add a ah-hoc pattern with two PHI for isKnownNonEqual
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 11:01:28 PDT 2021
nikic added a comment.
Can you please add tests for this functionality in llvm/test/Analysis/ValueTracking/known-non-equal.ll? These are simpler than going through BasicAA.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2548
+ // to the PHI's block.
+ if (Q.DT->dominates(PN1->getParent(), Pred)) {
+ // loop:
----------------
I don't understand why this code is needed. For your example you are comparing `%cmp.0` and `%mul = mul nsw i32 %cmp.0, 2`, which should already be recognized as non-equal. What is this backedge check for?
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2553
+ // ...
+ // %inc = add i32 %cmp.0, 1
+ // br label %loop
----------------
`%inc` is not used in the phi nodes, so it's not clear what the relation is. Maybe you meant to replace `%mul` with `%inc`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98422/new/
https://reviews.llvm.org/D98422
More information about the llvm-commits
mailing list