aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/LevelRaise.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-05 19:40:32 +0000
committerChris Lattner <sabre@nondot.org>2001-12-05 19:40:32 +0000
commit8da5d426d12bea312b24f54c08810835228b32b8 (patch)
tree13d4c04d89d4df74bbbc8f5bd5ccb618baeec3c2 /lib/Transforms/LevelRaise.cpp
parentac0077e1434a1b0d227ac6a3c4e4a0d0a309af28 (diff)
downloadexternal_llvm-8da5d426d12bea312b24f54c08810835228b32b8.zip
external_llvm-8da5d426d12bea312b24f54c08810835228b32b8.tar.gz
external_llvm-8da5d426d12bea312b24f54c08810835228b32b8.tar.bz2
Fix pessimizations on sized arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/LevelRaise.cpp')
-rw-r--r--lib/Transforms/LevelRaise.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index f155c50..19325b0 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<MethodType>(ElTy) || isa<ArrayType>(ElTy)) return false;
+ if (isa<MethodType>(ElTy) ||
+ (isa<ArrayType>(ElTy) && cast<ArrayType>(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;