[PATCH] D32508: [ValueTracking] Begin adding some useful methods to the proposed KnownBits struct

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 03:32:41 PDT 2017


RKSimon added a comment.

I realise there are plenty of possible helpers but zextOrTrunc and clearAllBits would definitely be useful.



================
Comment at: include/llvm/Support/KnownBits.h:51
+  /// Returns true if we know the value of all bits.
+  bool isComplete() const {
+    assert(isValid() && "KnownBits conflict!");
----------------
 <bikeshed>Not too sure about isComplete - bit too similar to isValid?</bikeshed>

If isComplete and getValue are likely to always be used together is it worth merging them into a single method:
```
bool isCompleteValue(APInt &) ?
```


https://reviews.llvm.org/D32508





More information about the llvm-commits mailing list