[llvm] [ValueTracking] Infer is-power-of-2 from assumptions. (PR #107745)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 8 06:57:23 PDT 2024


================
@@ -9950,6 +9981,10 @@ void llvm::findValuesAffectedByCondition(
             InsertAffected(X);
         }
       }
+
+      if (IsAssume && HasRHSC &&
+          match(A, m_Intrinsic<Intrinsic::ctpop>(m_Value(X))))
+        AddAffected(X);
----------------
andjo403 wrote:

do you know why adding the `AddAffected(X)` is affecting the result of `isKnownNonZero` so that the range in `@pow2_32_gtnonconst_assume` get worse?

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


More information about the llvm-commits mailing list