vector casts never reinterpret bits
authorChris Lattner <sabre@nondot.org>
Sun, 2 Apr 2006 05:40:28 +0000 (05:40 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Apr 2006 05:40:28 +0000 (05:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27354 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 59467c2122ab03040fd773de4bfe00bf819e85bf..767df24f279e207358de3c05e391103d95674738 100644 (file)
@@ -75,6 +75,11 @@ const Type *Type::getPrimitiveType(TypeID IDNumber) {
 //
 bool Type::isLosslesslyConvertibleTo(const Type *Ty) const {
   if (this == Ty) return true;
+  
+  // Packed type conversions are always bitwise.
+  if (isa<PackedType>(this) && isa<PackedType>(Ty))
+    return true;
+  
   if ((!isPrimitiveType()    && !isa<PointerType>(this)) ||
       (!isa<PointerType>(Ty) && !Ty->isPrimitiveType())) return false;