[PATCH] D128911: Emit table lookup from TargetLowering::expandCTTZ()

Shubham Narlawar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 04:23:23 PDT 2022


gsocshubham added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7840
+  SDValue Neg = DAG.getNode(ISD::SUB, dl, VT, DAG.getConstant(0, dl, VT), Op);
+  SDValue Lookup = DAG.getNode(
+      ISD::SRL, dl, VT,
----------------
dmgreen wrote:
> This needs to be in a `if (NumBitsPerElt == 32 && !VT.isVector())` block. Hopefully with other types available too. Else it would fall back to the existing CTPop. If the CTPOP is legal it is worth using it too, instead of this table lookup.
Done.


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

https://reviews.llvm.org/D128911



More information about the llvm-commits mailing list