summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-09-14 10:26:34 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-09-14 10:26:34 +0000
commitb0de6ddbe090fe4e1897f244bdcf189162e1ba08 (patch)
treefe5f74ac2239150b27de1462a7bb564c2fc9f0b0 /llvm/lib/Transforms
parent6ba9824c2b97da8abb07d4c122055412d176815d (diff)
downloadbcm5719-llvm-b0de6ddbe090fe4e1897f244bdcf189162e1ba08.tar.gz
bcm5719-llvm-b0de6ddbe090fe4e1897f244bdcf189162e1ba08.zip
Add two asserts that Duncan thought would help ensure things don't rot
unexpectedly in the future. More fixes from his code review. llvm-svn: 163891
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SROA.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index be7839e4c36..44ffb02552c 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -567,6 +567,7 @@ private:
bool visitMemSetInst(MemSetInst &II) {
+ assert(II.getRawDest() == *U && "Pointer use is not the destination?");
ConstantInt *Length = dyn_cast<ConstantInt>(II.getLength());
insertUse(II, Length ? Length->getZExtValue() : AllocSize - Offset, Length);
return true;
@@ -2440,6 +2441,7 @@ bool SROA::rewriteAllocaPartition(AllocaInst &AI,
AllocaTy = Type::getIntNTy(*C, AllocaSize * 8);
if (!AllocaTy)
AllocaTy = ArrayType::get(Type::getInt8Ty(*C), AllocaSize);
+ assert(TD->getTypeAllocSize(AllocaTy) >= AllocaSize);
// Check for the case where we're going to rewrite to a new alloca of the
// exact same type as the original, and with the same access offsets. In that
OpenPOWER on IntegriCloud