[InstCombine] fold ctpop-of-select with 1 or more constant arms
authorSanjay Patel <spatel@rotateright.com>
Sun, 20 Jun 2021 15:26:11 +0000 (11:26 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 20 Jun 2021 15:28:45 +0000 (11:28 -0400)
commit4c44b02d87bce42452594096cc0e9245d94596a8
tree55e26bd313a1333f0a082bd0a9ede9642d3550ba
parent56aac567acfd696f54163e33d8df02dc2ad3a72e
[InstCombine] fold ctpop-of-select with 1 or more constant arms

The general pattern is mentioned in:
https://llvm.org/PR50140
...but we need to do a bit more to handle intrinsics with extra operands
like ctlz/cttz.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/intrinsic-select.ll