[PATCH] D150094: [KnownBits] Improve `KnownBits::udiv`

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 03:41:16 PDT 2023


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM with a couple of minors



================
Comment at: llvm/lib/Support/KnownBits.cpp:602
   // treat a udiv as a logical right shift by the power of 2 known to
   // be less than the denominator.
+  APInt MinDenum = RHS.getMinValue();
----------------
Update comment?


================
Comment at: llvm/lib/Support/KnownBits.cpp:611
+  if (Exact) {
+      // Odd / Odd -> Odd
+    if (LHS.One[0] && RHS.One[0])
----------------
Indentation


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150094



More information about the llvm-commits mailing list