diff options
author | Jakub Staszak <jstaszak@apple.com> | 2011-09-02 14:57:37 +0000 |
---|---|---|
committer | Jakub Staszak <jstaszak@apple.com> | 2011-09-02 14:57:37 +0000 |
commit | 7470fb01d00e559eb9bed5fe00ba7feeb427d5f9 (patch) | |
tree | 5aa0c0df638d863d387bb18901f316bed507e78d /llvm/lib/Transforms/Scalar/GVN.cpp | |
parent | f5769c10702322feaea70d98978cb9c39d609812 (diff) | |
download | bcm5719-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.cpp | 4 |
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) { |