[llvm] [ValueTracking] Infer NonEqual from dominating conditions/assumptions (PR #117442)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 03:21:03 PST 2024


================
@@ -10037,10 +10081,10 @@ void llvm::findValuesAffectedByCondition(
         Worklist.push_back(B);
       }
     } else if (match(V, m_ICmp(Pred, m_Value(A), m_Value(B)))) {
-      AddCmpOperands(A, B);
-
       bool HasRHSC = match(B, m_ConstantInt());
       if (ICmpInst::isEquality(Pred)) {
+        AddAffected(A);
+        AddAffected(B);
----------------
dtcxzyw wrote:

> Something we could do is add a bitfield for what the affected value is for (e.g. knownbits, etc), so we can quickly skip ones that are not relevant.

Are you working on this?


https://github.com/llvm/llvm-project/pull/117442


More information about the llvm-commits mailing list