From bde9b14c6f0811a0af0b3e7272ed5a4fcce39fef Mon Sep 17 00:00:00 2001 From: Nikolai Bozhenov Date: Fri, 30 Jun 2017 10:39:09 +0000 Subject: Revert of r306525: "Canonicalize clamp of float types to minmax" llvm-svn: 306815 --- llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index c15fd35e47c..80c6595904e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -1374,16 +1374,9 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { auto SPF = SPR.Flavor; if (SelectPatternResult::isMinOrMax(SPF)) { - // Canonicalize so that - // - type casts are outside select patterns. - // - float clamp is transformed to min/max pattern - Value *CmpLHS = cast(CondVal)->getOperand(0); - Value *CmpRHS = cast(CondVal)->getOperand(1); - if ((LHS->getType()->getPrimitiveSizeInBits() != - SelType->getPrimitiveSizeInBits()) || - (LHS->getType()->isFPOrFPVectorTy() && - ((CmpLHS != LHS && CmpLHS != RHS) || - (CmpRHS != LHS && CmpRHS != RHS)))) { + // Canonicalize so that type casts are outside select patterns. + if (LHS->getType()->getPrimitiveSizeInBits() != + SelType->getPrimitiveSizeInBits()) { CmpInst::Predicate Pred = getCmpPredicateForMinMax(SPF, SPR.Ordered); Value *Cmp; -- cgit v1.2.3