[SROA] Fix a *glaring* bug in r202091: you have to actually *write*
authorChandler Carruth <chandlerc@gmail.com>
Tue, 25 Feb 2014 09:45:27 +0000 (09:45 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 25 Feb 2014 09:45:27 +0000 (09:45 +0000)
the break statement, not just think it to yourself....

No idea how this worked at all, much less survived most bots, my
bootstrap, and some bot bootstraps!

The Polly one didn't survive, and this was filed as PR18959. I don't
have a reduced test case and honestly I'm not seeing the need. What we
probably need here are better asserts / debug-build behavior in
SmallPtrSet so that this madness doesn't make it so far.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202129 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SROA.cpp

index 107b1b41a8466689e27144ba44797c34eaaaf06e..67903230f365f5c9683d0d4646ddfe090ba80246 100644 (file)
@@ -3169,6 +3169,7 @@ bool SROA::rewritePartition(AllocaInst &AI, AllocaSlices &S,
       Promotable = false;
       PHIUsers.clear();
       SelectUsers.clear();
+      break;
     }
   for (SmallPtrSetImpl<SelectInst *>::iterator I = SelectUsers.begin(),
                                                E = SelectUsers.end();
@@ -3177,6 +3178,7 @@ bool SROA::rewritePartition(AllocaInst &AI, AllocaSlices &S,
       Promotable = false;
       PHIUsers.clear();
       SelectUsers.clear();
+      break;
     }
 
   if (Promotable) {