[PATCH] D68189: [InstCombine] recognize popcount implemented in hacker's delight.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 06:41:39 PDT 2019


shchenz added a comment.

In D68189#1687830 <https://reviews.llvm.org/D68189#1687830>, @xbolva00 wrote:

> Please add m_OneUse everywhere.


@xbolva00 Do we need to add m_OneUse for every operation? If some instruction like first lshr (`%2 = lshr i32 %0, 1`) has other use, it may still a win by doing this transformation.
Here if we do not consider m_OneUse issue, the worst case is: all instructions have other uses, and we can only replace final lshr (`%13 = lshr i32 %12, 24`) with popcount intrinsic. One instruction vs One intrinsic, I think it may be not a lose?


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

https://reviews.llvm.org/D68189





More information about the llvm-commits mailing list