summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-01 16:13:35 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-01 16:13:35 +0000
commit0ea4c3d8c0d6b0815aa1381167d0f53baf186dbd (patch)
tree7bd4bc8c032a47279dfcefde69fabfc1eae69c9c /lib
parenta6e23cc53585c09236feb12cb89e5dd0b461a6e0 (diff)
downloadllvm-0ea4c3d8c0d6b0815aa1381167d0f53baf186dbd.tar.gz
llvm-0ea4c3d8c0d6b0815aa1381167d0f53baf186dbd.tar.bz2
llvm-0ea4c3d8c0d6b0815aa1381167d0f53baf186dbd.tar.xz
SROA: Clean up unused assignment warnings from clang's analyzer.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index e73be5c04c..05401fe1b3 100644
--- a/lib/Transforms/Scalar/SROA.cpp
+++ b/lib/Transforms/Scalar/SROA.cpp
@@ -1971,15 +1971,14 @@ static bool isVectorPromotionViable(const DataLayout &TD,
if (!Ty)
return false;
- uint64_t VecSize = TD.getTypeSizeInBits(Ty);
uint64_t ElementSize = TD.getTypeSizeInBits(Ty->getScalarType());
// While the definition of LLVM vectors is bitpacked, we don't support sizes
// that aren't byte sized.
if (ElementSize % 8)
return false;
- assert((VecSize % 8) == 0 && "vector size not a multiple of element size?");
- VecSize /= 8;
+ assert((TD.getTypeSizeInBits(Ty) % 8) == 0 &&
+ "vector size not a multiple of element size?");
ElementSize /= 8;
for (; I != E; ++I) {
@@ -2724,8 +2723,7 @@ private:
// a sensible representation for the alloca type. This is essentially
// splatting the byte to a sufficiently wide integer, splatting it across
// any desired vector width, and bitcasting to the final type.
- uint64_t Size = EndOffset - BeginOffset;
- Value *V = getIntegerSplat(IRB, II.getValue(), Size);
+ Value *V;
if (VecTy) {
// If this is a memset of a vectorized alloca, insert it.
@@ -2751,6 +2749,7 @@ private:
// set integer.
assert(!II.isVolatile());
+ uint64_t Size = EndOffset - BeginOffset;
V = getIntegerSplat(IRB, II.getValue(), Size);
if (IntTy && (BeginOffset != NewAllocaBeginOffset ||