[PATCH] D87034: [KnownBits] Implement accurate unsigned and signed max and min
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 3 13:01:58 PDT 2020
nikic accepted this revision.
nikic added a comment.
LG as well.
================
Comment at: llvm/lib/Support/KnownBits.cpp:89
+ // strictly greater than Val.
+ unsigned N = (~Zero & ~Val).countLeadingZeros();
+
----------------
Personally I'd write this as `unsigned N = (Zero | Val).countLeadingOnes()` (with the comment something like "determine number of known leading bits"). Okay either way though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87034/new/
https://reviews.llvm.org/D87034
More information about the llvm-commits
mailing list