diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index c6a5a40d768e..a28de703e54b 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -2119,9 +2119,7 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc, // If AltiVec, the comparison results in a numeric type, so we use // intrinsics comparing vectors and giving 0 or 1 as a result - if (LHSTy->isVectorType() && - LHSTy->getAs()->getVectorKind() == - VectorType::AltiVecVector) { + if (LHSTy->isVectorType() && !E->getType()->isVectorType()) { // constants for mapping CR6 register bits to predicate result enum { CR6_EQ=0, CR6_EQ_REV, CR6_LT, CR6_LT_REV } CR6; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 214edf145c0f..945d35e8ce8b 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -7282,9 +7282,7 @@ QualType Sema::CheckVectorCompareOperands(Expr *&lex, Expr *&rex, // If AltiVec, the comparison results in a numeric type, i.e. // bool for C++, int for C - if (lType->getAs()->getVectorKind() == VectorType::AltiVecVector - && rType->getAs()->getVectorKind() == - VectorType::AltiVecVector) + if (vType->getAs()->getVectorKind() == VectorType::AltiVecVector) return Context.getLogicalOperationType(); // For non-floating point types, check for self-comparisons of the form