mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-08 19:46:39 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5fbf09a69f
commit
b90f1fd9fb
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user