[InstCombine] fold ctlz/cttz-of-select with 1 or more constant arms
authorSanjay Patel <spatel@rotateright.com>
Mon, 21 Jun 2021 14:51:30 +0000 (10:51 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 21 Jun 2021 15:04:12 +0000 (11:04 -0400)
commit64b2676ca8290c7ff971c6f5b7a355b0ae7693de
tree9b7d0cfc2253e48f0bba1a3723f1f72084f6668b
parent4819cd162e92d44131444cb2b403028c0c5efe0a
[InstCombine] fold ctlz/cttz-of-select with 1 or more constant arms

Building on:
4c44b02d87
...and adding handling for the extra operand in these intrinsics.

This pattern is discussed in:
https://llvm.org/PR50140
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/intrinsic-select.ll