From a3124a3d1eb4349d22b4abaac3a08b4d112d87a5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Apr 2006 05:40:28 +0000 Subject: [PATCH] vector casts never reinterpret bits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27354 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Type.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 59467c2122a..767df24f279 100644 --- a/lib/VMCore/Type.cpp +++ b/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;