summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorJakub Staszak <jstaszak@apple.com>2011-09-02 14:57:37 +0000
committerJakub Staszak <jstaszak@apple.com>2011-09-02 14:57:37 +0000
commit7470fb01d00e559eb9bed5fe00ba7feeb427d5f9 (patch)
tree5aa0c0df638d863d387bb18901f316bed507e78d /llvm/lib/Transforms/Scalar/GVN.cpp
parentf5769c10702322feaea70d98978cb9c39d609812 (diff)
downloadbcm5719-llvm-7470fb01d00e559eb9bed5fe00ba7feeb427d5f9.tar.gz
bcm5719-llvm-7470fb01d00e559eb9bed5fe00ba7feeb427d5f9.zip
Compare type size instead of type _store_ size to make sure that BitCastInst
will be valid. This fixes PR10820. llvm-svn: 139005
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVN.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 3b4c252990a..e3f61b5dff7 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -689,8 +689,8 @@ static Value *CoerceAvailableValueToLoadType(Value *StoredVal,
// If this is already the right type, just return it.
Type *StoredValTy = StoredVal->getType();
- uint64_t StoreSize = TD.getTypeStoreSizeInBits(StoredValTy);
- uint64_t LoadSize = TD.getTypeStoreSizeInBits(LoadedTy);
+ uint64_t StoreSize = TD.getTypeSizeInBits(StoredValTy);
+ uint64_t LoadSize = TD.getTypeSizeInBits(LoadedTy);
// If the store and reload are the same size, we can always reuse it.
if (StoreSize == LoadSize) {
OpenPOWER on IntegriCloud