[PATCH] D147897: [ValueTracking] Use maximum shift count in `shl` when determining if `shl` can be zero.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 09:52:27 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2688
+          computeKnownBits(I->getOperand(1), DemandedElts, Depth, Q);
+      if (!Known.One.shl(KnownCnt.getMaxValue()).isZero())
+        return true;
----------------
nikic wrote:
> Isn't this going to assert if the max value is wider than the bit width?
Should probably just use `KnownBits::shl()` here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147897



More information about the llvm-commits mailing list