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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 16:12:06 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:

I have implemented a prototype (see https://github.com/llvm/llvm-project/pull/118493). But the compile-time impact looks worse: http://llvm-compile-time-tracker.com/compare.php?from=8f3cf204bb91ce09fb3651b8a7e770de7e603b2f&to=338d7fc5b72e20f1606a28f740d5a0068c95d94b&stat=instructions%3Au

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


More information about the llvm-commits mailing list