[FastISel] Insert patchpoint instruction before the target generated call instruction.
authorJuergen Ributzka <juergen@apple.com>
Tue, 15 Jul 2014 02:22:46 +0000 (02:22 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 15 Jul 2014 02:22:46 +0000 (02:22 +0000)
The patchpoint instruction should have been inserted before the target
generated call instruction to be inside the ADJSTACKDOWN/ADJSTACKUP call
sequence window.

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

lib/CodeGen/SelectionDAG/FastISel.cpp

index 0cd5facbb5eeb08b7322fa051691db06ce4edd1b..885137302d3af9b43635d88ce3f095f063590b28 100644 (file)
@@ -826,7 +826,8 @@ bool FastISel::SelectPatchpoint(const CallInst *I) {
     Ops.push_back(MachineOperand::CreateReg(Reg, /*IsDef=*/true,
                                             /*IsImpl=*/true));
 
-  MachineInstrBuilder MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
+  // Insert the patchpoint instruction before the call generated by the target.
+  MachineInstrBuilder MIB = BuildMI(*FuncInfo.MBB, CLI.Call, DbgLoc,
                                     TII.get(TargetOpcode::PATCHPOINT));
 
   for (auto &MO : Ops)