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

Jay Foad via libc-commits libc-commits at lists.llvm.org
Fri May 17 01:47:38 PDT 2024


================
@@ -774,6 +774,39 @@ KnownBits KnownBits::usub_sat(const KnownBits &LHS, const KnownBits &RHS) {
   return computeForSatAddSub(/*Add*/ false, /*Signed*/ false, LHS, RHS);
 }
 
+KnownBits KnownBits::avgCompute(const KnownBits &LHS, const KnownBits &RHS,
+                                bool IsCeil, bool IsSigned) {
+  KnownBits Known = LHS;
----------------
jayfoad wrote:

It might be neater to pass LHS and RHS in by value, instead of by const ref, so that you don't need to copy them here.

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


More information about the libc-commits mailing list