From 7d7b4b4014c19149e710368d20955cdc2a872e3b Mon Sep 17 00:00:00 2001 From: Arnold Schwaighofer Date: Fri, 9 Sep 2016 21:18:47 +0000 Subject: Create phi nodes for swifterror values at the end of the phi instructions list ISel makes assumption about the order of phi nodes. rdar://28190150 llvm-svn: 281095 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index b9c4eb3f43b..9d06a4f64be 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1253,7 +1253,7 @@ static void mergeIncomingSwiftErrors(FunctionLoweringInfo *FuncInfo, FuncInfo->SwiftErrorMap[FuncInfo->MBB].push_back(VReg); MachineInstrBuilder SwiftErrorPHI = BuildMI(*FuncInfo->MBB, - FuncInfo->MBB->begin(), SDB->getCurDebugLoc(), + FuncInfo->InsertPt, SDB->getCurDebugLoc(), TII->get(TargetOpcode::PHI), VReg); for (const_pred_iterator PI = pred_begin(LLVMBB), PE = pred_end(LLVMBB); PI != PE; ++PI) { -- cgit v1.2.3