From 8da5d426d12bea312b24f54c08810835228b32b8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 5 Dec 2001 19:40:32 +0000 Subject: [PATCH] Fix pessimizations on sized arrays git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1423 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/LevelRaise.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index f155c507097..19325b065c2 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -539,7 +539,9 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB, if (!ThePtrType) return false; const Type *ElTy = ThePtrType->getElementType(); - if (isa(ElTy) || isa(ElTy)) return false; + if (isa(ElTy) || + (isa(ElTy) && cast(ElTy)->isUnsized())) + return false; unsigned ElementSize = TD.getTypeSize(ElTy); bool InsertCast = false; @@ -586,7 +588,7 @@ static bool DoInsertArrayCast(Value *V, BasicBlock *BB, // ValueTypeCache ConvertedTypes; if (!ValueConvertableToType(V, DestTy, ConvertedTypes)) { - cerr << "FAILED to convert types of values for " << V << "\n"; + cerr << "FAILED to convert types of values for " << V << " to " << DestTy << "\n"; ConvertedTypes.clear(); ValueConvertableToType(V, DestTy, ConvertedTypes); return false;