From 662a17ba5fe0180e33c1c5772a7272a5dcbb49d3 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 llvm-svn: 1423 --- 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;