summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNikolai Bozhenov <nikolai.bozhenov@intel.com>2017-06-30 10:39:09 +0000
committerNikolai Bozhenov <nikolai.bozhenov@intel.com>2017-06-30 10:39:09 +0000
commitbde9b14c6f0811a0af0b3e7272ed5a4fcce39fef (patch)
treed1dc53bab2280c074359fef216d46aaf7e330111 /llvm/lib/Transforms
parent892c6c86ea25dc97668ff1f1b7bf1108e85fa5ec (diff)
downloadbcm5719-llvm-bde9b14c6f0811a0af0b3e7272ed5a4fcce39fef.tar.gz
bcm5719-llvm-bde9b14c6f0811a0af0b3e7272ed5a4fcce39fef.zip
Revert of r306525: "Canonicalize clamp of float types to minmax"
llvm-svn: 306815
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp13
1 files changed, 3 insertions, 10 deletions
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<CmpInst>(CondVal)->getOperand(0);
- Value *CmpRHS = cast<CmpInst>(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;
OpenPOWER on IntegriCloud