diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-25 16:05:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-25 16:05:33 +0000 |
commit | 482817a2244dbf1657cbfaa5a290e16aa3b0f33e (patch) | |
tree | d76ee7af2c05716343e2ea06455e5854055dced6 /lib | |
parent | 6dd8e0773630c48e4f7d2cb317be03167d08fc0b (diff) | |
download | external_llvm-482817a2244dbf1657cbfaa5a290e16aa3b0f33e.zip external_llvm-482817a2244dbf1657cbfaa5a290e16aa3b0f33e.tar.gz external_llvm-482817a2244dbf1657cbfaa5a290e16aa3b0f33e.tar.bz2 |
Remove code which assumes it knows how vectors are stored in memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 36b307c..44df49c 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -334,11 +334,7 @@ static Constant *getFoldedSizeOf(const Type *Ty, const Type *DestTy, Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); return ConstantExpr::getNUWMul(E, N); } - if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) { - Constant *N = ConstantInt::get(DestTy, VTy->getNumElements()); - Constant *E = getFoldedSizeOf(VTy->getElementType(), DestTy, true); - return ConstantExpr::getNUWMul(E, N); - } + if (const StructType *STy = dyn_cast<StructType>(Ty)) if (!STy->isPacked()) { unsigned NumElems = STy->getNumElements(); @@ -464,13 +460,7 @@ static Constant *getFoldedOffsetOf(const Type *Ty, Constant *FieldNo, Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); return ConstantExpr::getNUWMul(E, N); } - if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) { - Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, false, - DestTy, false), - FieldNo, DestTy); - Constant *E = getFoldedSizeOf(VTy->getElementType(), DestTy, true); - return ConstantExpr::getNUWMul(E, N); - } + if (const StructType *STy = dyn_cast<StructType>(Ty)) if (!STy->isPacked()) { unsigned NumElems = STy->getNumElements(); |