[llvm] [ValueTracking][X86] Compute KnownBits for phadd/phsub (PR #92429)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 03:41:00 PDT 2024


================
@@ -36953,6 +36934,34 @@ static void computeKnownBitsForPSADBW(SDValue LHS, SDValue RHS,
   Known = Known.zext(64);
 }
 
+static KnownBits computeKnownBitsForHorizontalOperation(
+    const SDValue Op, const APInt &DemandedElts, unsigned Depth,
+    unsigned OpIndexStart, const SelectionDAG &DAG,
+    const function_ref<KnownBits(const KnownBits &, const KnownBits &)>
+        KnownBitsFunc) {
+  APInt DemandedEltsLHS, DemandedEltsRHS;
+  getHorizDemandedEltsForFirstOperand(Op.getValueType().getSizeInBits(),
+                                      DemandedElts, DemandedEltsLHS,
+                                      DemandedEltsRHS);
+
+  const auto ComputeForSingleOpFunc =
+      [&DAG, Depth, KnownBitsFunc](const SDValue &Op, APInt &DemandedEltsOp) {
----------------
RKSimon wrote:

const SDValue &Op -> const SDValue &Op

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


More information about the llvm-commits mailing list