[PATCH] D53258: [LegalizeDAG] Add generic vector CTPOP expansion (PR32655)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 15:23:04 PDT 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:4219
   assert(VT.isInteger() && Len <= 128 && Len % 8 == 0 &&
          "CTPOP not implemented for this type.");
 
----------------
It doesn't seem safe to assert that all legal integer vector types (or, more generally, all legal integer types) have size between i8 and i128.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:4226
+                        (Len != 8 && !isOperationLegalOrCustom(ISD::MUL, VT)) ||
+                        !isOperationLegalOrCustomOrPromote(ISD::AND, VT)))
+    return false;
----------------
I'm sort of on the fence about whether this check should be here, or in VectorLegalizer::ExpandCTPOP.  Either way works, I guess.


Repository:
  rL LLVM

https://reviews.llvm.org/D53258





More information about the llvm-commits mailing list