Revert "[InstCombine] do not exclude min/max from icmp with casted operand fold"
authorSanjay Patel <spatel@rotateright.com>
Thu, 2 Apr 2020 13:09:17 +0000 (09:09 -0400)
committerSanjay Patel <spatel@rotateright.com>
Thu, 2 Apr 2020 13:15:23 +0000 (09:15 -0400)
commit1008435f3d47ac0f49690c52cb8ae3af6e3b9c4b
treed843f45c740749c2c7ecbd66b350e5970ad6920a
parentc00cb76274fdcc529335f55b0d19e6bc42ea9d8d
Revert "[InstCombine] do not exclude min/max from icmp with casted operand fold"

This reverts commit f2fbdf76d8d07f6a0fbd97825cbc533660d64a37.
As noted in the post-commit thread:
https://reviews.llvm.org/rGf2fbdf76d8d0
...this can obscure a min/max pattern where the components
have extra uses. We can show that the problem is independent
of this change with a slightly modified source example, so
this revert just delays/reduces the need to fix the real
problem.

We need to improve our analysis of negation or -- more
generally -- subtraction using patches like D77230 or D68408.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/adjust-for-minmax.ll
llvm/test/Transforms/InstCombine/select_meta.ll