diff options
author | Juergen Ributzka <juergen@apple.com> | 2014-07-15 02:22:43 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2014-07-15 02:22:43 +0000 |
commit | a41594359084b9fba0829ddc1b591d8f237350f0 (patch) | |
tree | 4840a1e429a12a912dd25a578228fadc9e91be7b /llvm/lib/CodeGen | |
parent | 833ed943d643b8c5a889a8fe1a3486a41201458c (diff) | |
download | bcm5719-llvm-a41594359084b9fba0829ddc1b591d8f237350f0.tar.gz bcm5719-llvm-a41594359084b9fba0829ddc1b591d8f237350f0.zip |
[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.
llvm-svn: 213033
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 45c775dca29..0cd5facbb5e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -748,10 +748,11 @@ bool FastISel::SelectPatchpoint(const CallInst *I) { 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 CallInst *I) { // 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; } |