[PATCH] D159283: Add intrinsic to count trailing zero elements in a vector

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 08:13:47 PDT 2023


kmclaughlin added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.h:338
 
+  CTTZ_ELTS,
+
----------------
nikic wrote:
> If you need an ISD opcode anyway, maybe make it a generic one right away? Having a generic ISD opcode and expanding it during legalization is generally preferred over doing an expansion in SDAGBuilder, as this allows for more optimal legalizations if the operation is supported only for some types.
Adding a generic opcode for this would introduce a lot of additional complexity with legalisation, and splitting/promoting the operand would likely result in poor CodeGen. It seemed better to avoid this by expanding the intrinsic in SelectionDAGBuilder as we have for others such as get_active_lane_mask, at least until other targets really need full legalisation support.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159283/new/

https://reviews.llvm.org/D159283



More information about the llvm-commits mailing list