[PATCH] D149418: [ValueTracking] Add additional cases for `isKnownNonZero(mul X, Y)`

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 00:51:58 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2897
+      SelfMultiply &= isGuaranteedNotToBeUndefOrPoison(I->getOperand(0), Q.AC,
+                                                       Q.CxtI, Q.DT, Depth + 1);
+    return KnownBits::mul(XKnown, YKnown, SelfMultiply).isNonZero();
----------------
You can drop the SelfMultiply handling as well. It only determines that the low bit is zero, which is not useful if we want a non-zero result.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149418



More information about the llvm-commits mailing list