diff options
author | Craig Topper <craig.topper@intel.com> | 2018-05-18 21:21:56 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-05-18 21:21:56 +0000 |
commit | 0198b73769e4ff37cc122a11c3fdea575d1a2e08 (patch) | |
tree | c3786c380879347b789afb6b842536807fa48eb7 /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | |
parent | 4bbc6b55e7bc13b04eb7e47f6cc6df17e508a270 (diff) | |
download | bcm5719-llvm-0198b73769e4ff37cc122a11c3fdea575d1a2e08.tar.gz bcm5719-llvm-0198b73769e4ff37cc122a11c3fdea575d1a2e08.zip |
[InstCombine] Qualify a select pattern based transform to restrct to only min/max and ignore abs/nabs.
llvm-svn: 332770
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index b4db091a439..b7735c43dd7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -938,7 +938,7 @@ Instruction *InstCombiner::foldSPFofSPF(Instruction *Inner, if (C == A || C == B) { // MAX(MAX(A, B), B) -> MAX(A, B) // MIN(MIN(a, b), a) -> MIN(a, b) - if (SPF1 == SPF2) + if (SPF1 == SPF2 && SelectPatternResult::isMinOrMax(SPF1)) return replaceInstUsesWith(Outer, Inner); // MAX(MIN(a, b), a) -> a |