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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 11:10:14 PST 2021


craig.topper added inline comments.


================
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;
----------------
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.


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