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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 14:03:25 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:615
+  // original type.
+  if (N->getOpcode() == ISD::CTPOP && !OVT.isVector() &&
+      !TLI.isOperationLegalOrCustomOrPromote(ISD::CTPOP, NVT)) {
----------------
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.


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