[WebAssembly] Fix the CFG Stackifier to handle unoptimized branches
[oota-llvm.git] / lib / Target / AMDGPU / SIAnnotateControlFlow.cpp
index ccfbf1bf19ed4aac571c7f2715def76d152510a2..fa4d24a2f25a84c1c57de8bf1ef90fc991744d22 100644 (file)
@@ -312,11 +312,10 @@ void SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) {
       if (std::find(Latches.begin(), Latches.end(), *PI) == Latches.end())
         Preds.push_back(*PI);
     }
-    BB = llvm::SplitBlockPredecessors(BB, Preds, "endcf.split", nullptr, DT,
-                                      LI, false);
+    BB = llvm::SplitBlockPredecessors(BB, Preds, "endcf.split", DT, LI, false);
   }
 
-  CallInst::Create(EndCf, popSaved(), "", BB->getFirstInsertionPt());
+  CallInst::Create(EndCf, popSaved(), "", &*BB->getFirstInsertionPt());
 }
 
 /// \brief Annotate the control flow with intrinsics so the backend can