[PATCH] D55877: [LIR] Add CTTZ support part2

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 19:21:07 PST 2018


tabloid.adroit created this revision.
Herald added a subscriber: llvm-commits.

Add a second idiom recognition (BitScan idiom) where bits of input
variable are scanned in order until hit a set bit:
scan-from-left-to-right means CTLZ; scan-from-right-to-left means CTTZ.
The starting bit index do not have to be first bit if we could prove
from CFG that preceding bits are zero.


Repository:
  rL LLVM

https://reviews.llvm.org/D55877

Files:
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  test/Transforms/LoopIdiom/X86/ctlz.ll
  test/Transforms/LoopIdiom/X86/cttz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55877.178832.patch
Type: text/x-patch
Size: 46400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181219/b8fea8e2/attachment.bin>


More information about the llvm-commits mailing list