[InstSimplify] add limit folds for fmin/fmax
authorSanjay Patel <spatel@rotateright.com>
Tue, 15 Sep 2020 14:30:35 +0000 (10:30 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 15 Sep 2020 14:58:44 +0000 (10:58 -0400)
commit8985755762a429573af2ce657274772339d3b9db
tree5b5938b54ae9d30fe0471ecaa5cbb7bbd7146111
parent7c6f5b7fbf5a9eee7f3ef9192c354d1536a8f1c6
[InstSimplify] add limit folds for fmin/fmax

If the constant operand is the opposite of the min/max value,
then the result must be the other value.

This is based on the similar codegen transform proposed in:
D87571
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/fminmax-folds.ll
llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll