[PATCH] D25910: [VectorLegalizer] Expansion of CTLZ using CTPOP when possible

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 09:01:24 PDT 2016


RKSimon created this revision.
RKSimon added reviewers: echristo, craig.topper, ab, spatel, andreadb.
RKSimon added a subscriber: llvm-commits.
RKSimon set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.

This patch avoids scalarization of CTLZ by instead expanding to use CTPOP (from "Hacker's Delight") when the necessary operations are available.

This also adds the necessary cost models for X86 SSE2 targets (the main beneficiary) to ensure vectorization only happens when its useful.


Repository:
  rL LLVM

https://reviews.llvm.org/D25910

Files:
  lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  test/Analysis/CostModel/X86/ctbits-cost.ll
  test/CodeGen/X86/vec_ctbits.ll
  test/CodeGen/X86/vector-lzcnt-128.ll
  test/Transforms/SLPVectorizer/X86/ctlz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25910.75592.patch
Type: text/x-patch
Size: 136438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161024/4c9b08ec/attachment.bin>


More information about the llvm-commits mailing list