summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SROA.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-17 18:48:07 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-17 18:48:07 +0000
commitb0de1e31d11056037c4db3e2ecfe1547e85c3e1c (patch)
tree3565004b2e1a2f4bb5e232bdd510a90465586383 /lib/Transforms/Scalar/SROA.cpp
parent788221398a2cdb219c37625b5176211e7c7d44a6 (diff)
downloadexternal_llvm-b0de1e31d11056037c4db3e2ecfe1547e85c3e1c.zip
external_llvm-b0de1e31d11056037c4db3e2ecfe1547e85c3e1c.tar.gz
external_llvm-b0de1e31d11056037c4db3e2ecfe1547e85c3e1c.tar.bz2
Fix another SROA crasher, PR14601.
This was a silly oversight, we weren't pruning allocas which were used by variable-length memory intrinsics from the set that could be widened and promoted as integers. Fix that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index ab61a2f..a0ee849 100644
--- a/lib/Transforms/Scalar/SROA.cpp
+++ b/lib/Transforms/Scalar/SROA.cpp
@@ -2150,7 +2150,7 @@ static bool isIntegerWideningViable(const DataLayout &TD,
!canConvertValue(TD, ValueTy, AllocaTy))
return false;
} else if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I->U->getUser())) {
- if (MI->isVolatile())
+ if (MI->isVolatile() || !isa<Constant>(MI->getLength()))
return false;
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(I->U->getUser())) {
const AllocaPartitioning::MemTransferOffsets &MTO