aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-08 20:01:44 +0000
committerChris Lattner <sabre@nondot.org>2010-05-08 20:01:44 +0000
commit7944c21cae06c5124cf1ee1f811d2a13f8e1b939 (patch)
tree559ff0c6dff05aed9b26ead363d9e3eeb7f773c5 /lib/Transforms
parentb54b9ddaaf2d258767d360583642ed1b91075fc9 (diff)
downloadexternal_llvm-7944c21cae06c5124cf1ee1f811d2a13f8e1b939.zip
external_llvm-7944c21cae06c5124cf1ee1f811d2a13f8e1b939.tar.gz
external_llvm-7944c21cae06c5124cf1ee1f811d2a13f8e1b939.tar.bz2
Fix PR7052, patch by Jakub Staszak!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index fdd1766..ca8ab49 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -868,7 +868,7 @@ static Value *CoerceAvailableValueToLoadType(Value *StoredVal,
const Type *StoredValTy = StoredVal->getType();
- uint64_t StoreSize = TD.getTypeSizeInBits(StoredValTy);
+ uint64_t StoreSize = TD.getTypeStoreSizeInBits(StoredValTy);
uint64_t LoadSize = TD.getTypeSizeInBits(LoadedTy);
// If the store and reload are the same size, we can always reuse it.
@@ -1132,8 +1132,8 @@ static Value *GetStoreValueForLoad(Value *SrcVal, unsigned Offset,
Instruction *InsertPt, const TargetData &TD){
LLVMContext &Ctx = SrcVal->getType()->getContext();
- uint64_t StoreSize = TD.getTypeSizeInBits(SrcVal->getType())/8;
- uint64_t LoadSize = TD.getTypeSizeInBits(LoadTy)/8;
+ uint64_t StoreSize = (TD.getTypeSizeInBits(SrcVal->getType()) + 7) / 8;
+ uint64_t LoadSize = (TD.getTypeSizeInBits(LoadTy) + 7) / 8;
IRBuilder<> Builder(InsertPt->getParent(), InsertPt);