[llvm] [llvm] Add KnownBits implementations for avgFloor and avgCeil (PR #86445)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 02:43:27 PDT 2024


================
@@ -354,6 +354,18 @@ struct KnownBits {
   /// Compute knownbits resulting from llvm.usub.sat(LHS, RHS)
   static KnownBits usub_sat(const KnownBits &LHS, const KnownBits &RHS);
 
+  /// Compute knownbits resulting from (C1 & C2) + (C1 ^ C2).ashr(1)
----------------
jayfoad wrote:

Putting the bit twidling formula in the comment is not helpful. Suggestion:
```suggestion
  /// Compute knownbits resulting from APIntOps::avgFloorS
```
Same for the others.

https://github.com/llvm/llvm-project/pull/86445


More information about the llvm-commits mailing list