[InstCombine] Support min/max intrinsics in udiv->lshr fold
authorNikita Popov <npopov@redhat.com>
Wed, 23 Feb 2022 14:49:12 +0000 (15:49 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 23 Feb 2022 14:51:36 +0000 (15:51 +0100)
commit587c7ff15c26d3a751fb6a10b2af60d4a25640c9
treeac2d237a89a9c1b988113603f71cd88f29fd3be8
parent2824a65c1ff5800879a0665eba12f7446ce2b653
[InstCombine] Support min/max intrinsics in udiv->lshr fold

This complements the existing fold for selects. This fold is a bit
more conservative, requiring one-use. The other folds here should
probably also be subjected to a one-use restriction.

https://alive2.llvm.org/ce/z/Q9eCDU
https://alive2.llvm.org/ce/z/8YK2CJ
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/div-shift.ll