Fix Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll
authorChris Lattner <sabre@nondot.org>
Thu, 20 Apr 2006 20:48:50 +0000 (20:48 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 Apr 2006 20:48:50 +0000 (20:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27912 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ScalarReplAggregates.cpp

index 9dec29cc592be89f840a7516cd99f3e2cb0589e1..f5bab8d8520f820c6a2fe6382f2557899196e7da 100644 (file)
@@ -143,7 +143,7 @@ bool SROA::performScalarRepl(Function &F) {
     // simple scalar value that can be mem2reg'd into a register value.
     bool IsNotTrivial = false;
     if (const Type *ActualType = CanConvertToScalar(AI, IsNotTrivial))
-      if (IsNotTrivial) {
+      if (IsNotTrivial && ActualType != Type::VoidTy) {
         ConvertToScalar(AI, ActualType);
         Changed = true;
         continue;