[llvm] [DAG] Add generic i8 CTPOP lowering using i32 MUL (PR #79989)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 08:35:20 PST 2024


================
@@ -8639,6 +8639,24 @@ SDValue TargetLowering::expandCTPOP(SDNode *Node, SelectionDAG &DAG) const {
   if (VT.isVector() && !canExpandVectorCTPOP(*this, VT))
     return SDValue();
 
+  // i8 CTPOP - with efficient i32 MUL, then attempt multiply-mask-multiply.
+  if (VT == MVT::i8 && shouldAllowMultiplyInBitCounts(MVT::i8, MVT::i32) &&
----------------
RKSimon wrote:

I've started going down that route, but its not looking great - I'm very tempted to just make this X86 only for now.

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


More information about the llvm-commits mailing list