[PATCH] D151816: [ValueTracking] Directly use KnownBits shift functions

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 13:46:42 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:994
+      Known.isNonZero() ||
+      (Known.getMaxValue().ult(Known.getBitWidth()) &&
+       isKnownNonZero(I->getOperand(1), DemandedElts, Depth + 1, Q));
----------------
nikic wrote:
> goldstein.w.n wrote:
> > what is the `Known.getMaxValue().ult(Known.getBitWidth())` is doing here?
> Nothing semantically meaningful. It only avoids calling isKnownNonZero() in substantially more cases than the old code.
How does Known.getMaxValue() u< Known.getBitWidth() prevent Known from being 0?


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

https://reviews.llvm.org/D151816



More information about the llvm-commits mailing list