]> granicus.if.org Git - clang/commitdiff
refactoring
authorAnton Yartsev <anton.yartsev@gmail.com>
Mon, 28 Mar 2011 21:00:05 +0000 (21:00 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Mon, 28 Mar 2011 21:00:05 +0000 (21:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128427 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp
lib/Sema/SemaExpr.cpp

index c6a5a40d768ec390c2809004129eb1f4e0f4942a..a28de703e54b0ae4186c53c5746090cb7200e9e5 100644 (file)
@@ -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<VectorType>()->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;
 
index 214edf145c0f8d0b030e2bd4e7f7b00994a14181..945d35e8ce8b109974b23182c78dcb7ca9417c5a 100644 (file)
@@ -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<VectorType>()->getVectorKind() == VectorType::AltiVecVector
-      && rType->getAs<VectorType>()->getVectorKind() ==
-         VectorType::AltiVecVector)
+  if (vType->getAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector)
     return Context.getLogicalOperationType();
 
   // For non-floating point types, check for self-comparisons of the form