There are no vectors of pointer or arrays, so we don't need to check vector
authorNick Lewycky <nicholas@mxc.ca>
Wed, 26 Jan 2011 08:50:18 +0000 (08:50 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 26 Jan 2011 08:50:18 +0000 (08:50 +0000)
elements for type equivalence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124284 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/MergeFunctions.cpp

index 15b6c56b66784128b4c2984fbb58da88e1d3143d..8aa7cb24b959f6ca2cc3808dd66b2cece0d32fe8 100644 (file)
@@ -295,6 +295,7 @@ bool FunctionComparator::isEquivalentType(const Type *Ty1,
     // Fall through in Release mode.
   case Type::IntegerTyID:
   case Type::OpaqueTyID:
+  case Type::VectorTyID:
     // Ty1 == Ty2 would have returned true earlier.
     return false;
 
@@ -353,13 +354,6 @@ bool FunctionComparator::isEquivalentType(const Type *Ty1,
     return ATy1->getNumElements() == ATy2->getNumElements() &&
            isEquivalentType(ATy1->getElementType(), ATy2->getElementType());
   }
-
-  case Type::VectorTyID: {
-    const VectorType *VTy1 = cast<VectorType>(Ty1);
-    const VectorType *VTy2 = cast<VectorType>(Ty2);
-    return VTy1->getNumElements() == VTy2->getNumElements() &&
-           isEquivalentType(VTy1->getElementType(), VTy2->getElementType());
-  }
   }
 }