[PATCH] D143363: [ValueTracking] Search dominate condition to check if a value is pow2 or not

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 19:47:02 PST 2023


StephenFan added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2274
+      // dominate condition popcount(v) < 2, v is pow2 or 0
+      if (OrZero && Pred == CmpInst::ICMP_ULT && *CmpConst == 2)
+        return true;
----------------
bcl5980 wrote:
> StephenFan wrote:
> > It seems it is no test coveraged here.
> I think @known_power_of_two_urem_dominate_y_and_yminus1_eq_0 already covered it.
Oh, It was covered. But only when `OrZero` is false, if it would be better to also cover the case that `OrZero` is true.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143363/new/

https://reviews.llvm.org/D143363



More information about the llvm-commits mailing list