[PATCH] D112268: [LegalizeTypes][RISCV][PowerPC] Expand CTLZ/CTTZ/CTPOP instead of promoting if they'll be expanded later.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 22 03:58:59 PDT 2021


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:615
+  // original type.
+  if (N->getOpcode() == ISD::CTPOP && !OVT.isVector() &&
+      !TLI.isOperationLegalOrCustomOrPromote(ISD::CTPOP, NVT)) {
----------------
craig.topper wrote:
> We should maybe expand parity as well to avoid an unneeded zero extend that SimplifyDemandedBits can't get rid of right now. Probably due to multiple uses. But we need to move ExpandPARITY from LegalizeDAG to TargetLowering first.
Add a TODO comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112268



More information about the llvm-commits mailing list