[llvm] [X86] computeKnownBitsForTargetNode - add INTRINSIC_WO_CHAIN handling for PSADBW intrinsics (PR #83580)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 21:47:44 PST 2024


================
@@ -36980,6 +36980,18 @@ void X86TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
     }
     break;
   }
+  case ISD::INTRINSIC_WO_CHAIN: {
+    switch (Op->getConstantOperandVal(0)) {
+    case Intrinsic::x86_sse2_psad_bw:
+    case Intrinsic::x86_avx2_psad_bw:
+    case Intrinsic::x86_avx512_psad_bw_512:
+      // PSADBW - fills low 16 bits and zeros upper 48 bits of each i64 result.
+      assert(VT.getScalarType() == MVT::i64 && "Unexpected PSADBW types");
+      Known.Zero.setBitsFrom(16);
+      break;
----------------
goldsteinn wrote:

This is obv improvement as is, but why did you drop your impl:
https://github.com/llvm/llvm-project/issues/81765#issuecomment-1954721173

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


More information about the llvm-commits mailing list