[RS4GC] Minor cleanup to `normalizeForInvokeSafepoint`; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 20 Oct 2015 01:06:17 +0000 (01:06 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 20 Oct 2015 01:06:17 +0000 (01:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250783 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

index ca92b14fd90ec7344e3f0c5d705fabaecf91c00b..a82750b2374d9e96b46b94e3442f27a76402ac80 100644 (file)
@@ -1249,14 +1249,14 @@ static BasicBlock *
 normalizeForInvokeSafepoint(BasicBlock *BB, BasicBlock *InvokeParent,
                             DominatorTree &DT) {
   BasicBlock *Ret = BB;
-  if (!BB->getUniquePredecessor()) {
+  if (!BB->getUniquePredecessor())
     Ret = SplitBlockPredecessors(BB, InvokeParent, "", &DT);
-  }
 
   // Now that 'ret' has unique predecessor we can safely remove all phi nodes
   // from it
   FoldSingleEntryPHINodes(Ret);
-  assert(!isa<PHINode>(Ret->begin()));
+  assert(!isa<PHINode>(Ret->begin()) &&
+         "All PHI nodes should have been removed!");
 
   // At this point, we can safely insert a gc.relocate as the first instruction
   // in Ret if needed.