[all-commits] [llvm/llvm-project] f24f09: [RISCV] Add TTI support for cpop with Zbb

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Mar 24 10:59:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f24f09d256ae8a67569f3fb2f766dad3712d9c19
      https://github.com/llvm/llvm-project/commit/f24f09d256ae8a67569f3fb2f766dad3712d9c19
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
    A llvm/test/Transforms/LoopIdiom/RISCV/lit.local.cfg
    A llvm/test/Transforms/LoopIdiom/RISCV/popcnt.ll

  Log Message:
  -----------
  [RISCV] Add TTI support for cpop with Zbb

This will tell loop idiom recognize that it can make popcount loops countable
using the ctpop intrinsic. I didn't bother checking for illegal types.
Type legalization knows how to split a ctpop into multiple ctops added together.
Assuming we only receive reasonable integer bit widths, a few cpop instructions
added together is probably better than the loop.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D99203




More information about the All-commits mailing list