[PATCH] D141990: [InstCombine] Add transform ctpop(X) -> 1 iff X is non-zero power of 2

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 09:24:17 PST 2023


craig.topper added a comment.

In D141990#4062660 <https://reviews.llvm.org/D141990#4062660>, @goldstein.w.n wrote:

> In D141990#4061264 <https://reviews.llvm.org/D141990#4061264>, @craig.topper wrote:
>
>> Can this be in InstSimplify?
>
> Where in `InstSimplify` should it go? Looking around there didn't seem any fitting place.

I think you can add it to the ctpop handling in `simplifyUnaryIntrinsic` in llvm/lib/Analysis/InstructionSimplify.cpp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141990



More information about the llvm-commits mailing list