[PATCH] D69387: [ConstantRange] Add toKnownBits() method

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 09:29:42 PDT 2019


lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/IR/ConstantRange.cpp:103
+      return Bit;
+    }
+    llvm_unreachable("Must have found bit mismatch.");
----------------
nikic wrote:
> Rather than looping over bits, which seems rather expensive to me, I'd suggest expressing this in terms of `(V0 ^ V1).countLeadingZeros()`.
This is the brute-force approach, i'm sinking it into APIntOps with proper implementation...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69387





More information about the llvm-commits mailing list