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

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 09:32:30 PST 2023


goldstein.w.n added a comment.

In D141990#4062665 <https://reviews.llvm.org/D141990#4062665>, @craig.topper wrote:

> 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

Ah, got it (I was looking in `lib/Transform`)


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