From d1ff5f1ee2d0222c80f14a813efb8c71ee25bef4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 22 Dec 2012 20:16:21 +0000 Subject: [PATCH] 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(-) diff --git a/contrib/llvm/lib/Transforms/Scalar/SROA.cpp b/contrib/llvm/lib/Transforms/Scalar/SROA.cpp index ccc2f7a77b3c..959b4e74c165 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