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

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 18:15:23 PDT 2024


================
@@ -3419,18 +3419,47 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
       Known = KnownBits::mulhs(Known, Known2);
     break;
   }
-  case ISD::AVGFLOORU:
-  case ISD::AVGCEILU:
-  case ISD::AVGFLOORS:
+  case ISD::AVGFLOORU: {
+    bool IsCeil = Opcode == ISD::AVGCEILU || Opcode == ISD::AVGCEILS;
+    bool IsSigned = Opcode == ISD::AVGFLOORS || Opcode == ISD::AVGCEILS;
----------------
goldsteinn wrote:

you don't need these opcode checks anymore since you have split the cases. Likewise below.

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


More information about the llvm-commits mailing list