[PATCH] D97124: [KnownBits][RISCV] Improve known bits for srem.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 13:19:18 PST 2021


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

LGTM



================
Comment at: llvm/lib/Support/KnownBits.cpp:480
+  // in the left hand side must also exist in the result.
+  Known.Zero.setHighBits(LHS.countMinLeadingZeros());
   return Known;
----------------
craig.topper wrote:
> RKSimon wrote:
> > I don't suppose this lets us make the KnownBitsTest exhaustive srem test more accurate? Most binops we still only checks for common subset bits when we might be able to check for exact equality now.
> I tried equality. It failed for both zeros and ones. We don't infer ones unless all bits of the RHS are known. For zeros we're only calculating an upper bound on the result.
Fair enough, thanks for trying.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97124



More information about the llvm-commits mailing list