From de145fce99c455d8d88617c0033a9e632285a4be Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 22 Dec 2012 20:16:21 +0000 Subject: Pull in r170353 from upstream llvm trunk: 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. This should fix the following assertion failure: Assertion failed: (CanSROA), function visitUsers, file /usr/src/lib/clang/libllvmscalaropts/../../../contrib/llvm/lib/Transforms/Scalar/SROA.cpp, line 2395. Reported by: gerald --- contrib/llvm/lib/Transforms/Scalar/SROA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/llvm/lib/Transforms') diff --git a/contrib/llvm/lib/Transforms/Scalar/SROA.cpp b/contrib/llvm/lib/Transforms/Scalar/SROA.cpp index ccc2f7a..959b4e7 100644 --- a/contrib/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/contrib/llvm/lib/Transforms/Scalar/SROA.cpp @@ -2224,7 +2224,7 @@ static bool isIntegerWideningViable(const DataLayout &TD, !canConvertValue(TD, ValueTy, AllocaTy)) return false; } else if (MemIntrinsic *MI = dyn_cast(I->U->getUser())) { - if (MI->isVolatile()) + if (MI->isVolatile() || !isa(MI->getLength())) return false; if (MemTransferInst *MTI = dyn_cast(I->U->getUser())) { const AllocaPartitioning::MemTransferOffsets &MTO -- cgit v1.1