diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-15 04:33:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-15 04:33:48 +0000 |
commit | adeb0a6e64c5a63e891e016226645f9595d00959 (patch) | |
tree | 81da09ffb7b6ca34fa001aac96be0147e42058cd /lib/VMCore/ConstantFold.cpp | |
parent | ca072a39778933df4264ae393bd0ca797db59df6 (diff) | |
download | external_llvm-adeb0a6e64c5a63e891e016226645f9595d00959.tar.gz external_llvm-adeb0a6e64c5a63e891e016226645f9595d00959.tar.bz2 external_llvm-adeb0a6e64c5a63e891e016226645f9595d00959.zip |
Make constant folding for GEPs a bit more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 30bae7162c..d1a9e7a70f 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -2209,7 +2209,7 @@ static Constant *ConstantFoldGetElementPtrImpl(Constant *C, I != E; ++I) LastTy = *I; - if ((LastTy && LastTy->isArrayTy()) || Idx0->isNullValue()) { + if ((LastTy && isa<SequentialType>(LastTy)) || Idx0->isNullValue()) { SmallVector<Value*, 16> NewIndices; NewIndices.reserve(Idxs.size() + CE->getNumOperands()); for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i) |