[PATCH] D59475: [ConstantRange] Add fromKnownBits() method

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 13:30:13 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/IR/ConstantRange.cpp:58-59
+ConstantRange ConstantRange::fromKnownBits(const KnownBits &Known,
+                                           bool IsSigned) {
+  if (Known.isUnknown())
+    return ConstantRange(Known.getBitWidth(), /* full */ true);
----------------
Last-minute thought: should there be a `assert(!Known.hasConflict() && "Expected valid KnownBits");` ?
The used methods of `KnownBits` won't assert that by themselves..


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59475





More information about the llvm-commits mailing list