Skip to content

[GlobalISel] Revise 'assignCustomValue' interface #77824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ class CallLowering {
/// \p If the handler wants the assignments to be delayed until after
/// mem loc assignments, then it sets \p Thunk to the thunk to do the
/// assignment.
/// \return The number of \p VAs that have been assigned after the first
/// one, and which should therefore be skipped from further
/// \return The number of \p VAs that have been assigned including the
/// first one, and which should therefore be skipped from further
/// processing.
virtual unsigned assignCustomValue(ArgInfo &Arg, ArrayRef<CCValAssign> VAs,
std::function<void()> *Thunk = nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ bool CallLowering::handleAssignments(ValueHandler &Handler,
DelayedOutgoingRegAssignments.emplace_back(Thunk);
if (!NumArgRegs)
return false;
j += NumArgRegs;
j += (NumArgRegs - 1);
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/ARM/ARMCallLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ struct ARMOutgoingValueHandler : public CallLowering::OutgoingValueHandler {
assignValueToReg(NewRegs[0], VA.getLocReg(), VA);
assignValueToReg(NewRegs[1], NextVA.getLocReg(), NextVA);
};
return 1;
return 2;
}
assignValueToReg(NewRegs[0], VA.getLocReg(), VA);
assignValueToReg(NewRegs[1], NextVA.getLocReg(), NextVA);
return 1;
return 2;
}

MachineInstrBuilder MIB;
Expand Down Expand Up @@ -341,7 +341,7 @@ struct ARMIncomingValueHandler : public CallLowering::IncomingValueHandler {

MIRBuilder.buildMergeLikeInstr(Arg.Regs[0], NewRegs);

return 1;
return 2;
}

/// Marking a physical register as used is different between formal
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/Mips/MipsCallLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ MipsIncomingValueHandler::assignCustomValue(CallLowering::ArgInfo &Arg,

markPhysRegUsed(VALo.getLocReg());
markPhysRegUsed(VAHi.getLocReg());
return 1;
return 2;
}

namespace {
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ struct RISCVOutgoingValueHandler : public CallLowering::OutgoingValueHandler {

if (Thunk) {
*Thunk = assignFunc;
return 1;
return 2;
}

assignFunc();
return 1;
return 2;
}

private:
Expand Down Expand Up @@ -266,7 +266,7 @@ struct RISCVIncomingValueHandler : public CallLowering::IncomingValueHandler {

MIRBuilder.buildMergeLikeInstr(Arg.Regs[0], NewRegs);

return 1;
return 2;
}

/// How the physical register gets marked varies between formal
Expand Down