From 7ee10dec05cdf2ddf24239aa8794402d77f385aa Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Apr 2006 05:40:28 +0000 Subject: vector casts never reinterpret bits llvm-svn: 27354 --- llvm/lib/VMCore/Type.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 59467c2122a..767df24f279 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -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(this) && isa(Ty)) + return true; + if ((!isPrimitiveType() && !isa(this)) || (!isa(Ty) && !Ty->isPrimitiveType())) return false; -- cgit v1.2.3