[llvm] r332770 - [InstCombine] Qualify a select pattern based transform to restrct to only min/max and ignore abs/nabs.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri May 18 14:21:57 PDT 2018
Author: ctopper
Date: Fri May 18 14:21:56 2018
New Revision: 332770
URL: http://llvm.org/viewvc/llvm-project?rev=332770&view=rev
Log:
[InstCombine] Qualify a select pattern based transform to restrct to only min/max and ignore abs/nabs.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=332770&r1=332769&r2=332770&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Fri May 18 14:21:56 2018
@@ -938,7 +938,7 @@ Instruction *InstCombiner::foldSPFofSPF(
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
More information about the llvm-commits
mailing list