[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 07:37:49 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:

seems like it is the `return false` here https://github.com/dtcxzyw/llvm-project/blob/ce9f5f9bfdf5253ea502b5ddf95135b0fa4380ab/llvm/lib/Analysis/ValueTracking.cpp#L616
that causes the regression if it is changed to a continue the range is unchanged by this PR

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


More information about the llvm-commits mailing list