[llvm] r213033 - [FastISel] Fix patchpoint lowering to set the result	register.
    Juergen Ributzka 
    juergen at apple.com
       
    Mon Jul 14 19:22:43 PDT 2014
    
    
  
Author: ributzka
Date: Mon Jul 14 21:22:43 2014
New Revision: 213033
URL: http://llvm.org/viewvc/llvm-project?rev=213033&view=rev
Log:
[FastISel] Fix patchpoint lowering to set the result register.
Always update the value map with the result register (if there is one), for the
patchpoint instruction we created to replace the target-specific call
instruction.
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=213033&r1=213032&r2=213033&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jul 14 21:22:43 2014
@@ -748,10 +748,11 @@ bool FastISel::SelectPatchpoint(const Ca
   SmallVector<MachineOperand, 32> Ops;
 
   // Add an explicit result reg if we use the anyreg calling convention.
-  unsigned ResultReg = 0;
   if (IsAnyRegCC && HasDef) {
-    ResultReg = createResultReg(TLI.getRegClassFor(MVT::i64));
-    Ops.push_back(MachineOperand::CreateReg(ResultReg, /*IsDef=*/true));
+    assert(CLI.NumResultRegs == 0 && "Unexpected result register.");
+    CLI.ResultReg = createResultReg(TLI.getRegClassFor(MVT::i64));
+    CLI.NumResultRegs = 1;
+    Ops.push_back(MachineOperand::CreateReg(CLI.ResultReg, /*IsDef=*/true));
   }
 
   // Add the <id> and <numBytes> constants.
@@ -839,8 +840,8 @@ bool FastISel::SelectPatchpoint(const Ca
   // Inform the Frame Information that we have a patchpoint in this function.
   FuncInfo.MF->getFrameInfo()->setHasPatchPoint();
 
-  if (ResultReg)
-    UpdateValueMap(I, ResultReg);
+  if (CLI.NumResultRegs)
+    UpdateValueMap(I, CLI.ResultReg, CLI.NumResultRegs);
   return true;
 }
 
    
    
More information about the llvm-commits
mailing list