-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[CodeGen] Refactor MachineInstr findRegisterDefOperandIdx/findRegisterDefOperand etc. to stop missing TRI args #82659
Comments
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Simon Pilgrim (RKSimon)
As noticed by @AtariDreams on #82411, by having the TargetRegisterInfo argument at the end of a long line of optional args, we are often missing it in our function calls and not correctly testing for super reg kill state etc.
int findRegisterUseOperandIdx(Register Reg, bool isKill = false, const TargetRegisterInfo *TRI = nullptr) const;
MachineOperand *findRegisterUseOperand(Register Reg, bool isKill = false, const TargetRegisterInfo *TRI = nullptr);
... etc ... ideally we need to refactor the calls so the TRI is no longer optional, so when we don't care about super-registers we explicitly have to set it nullptr. int findRegisterUseOperandIdx(Register Reg, const TargetRegisterInfo *TRI, bool isKill = false) const;
MachineOperand *findRegisterUseOperand(Register Reg, const TargetRegisterInfo *TRI, bool isKill = false);
... etc ... |
Hi! I am new to the LLVM project, and I would like to take this issue. Could anyone please assign this issue to me? |
@RKSimon Got it. |
@RKSimon Okay, will do it pretty soon. |
Fixes #82659 There are some functions, such as `findRegisterDefOperandIdx` and `findRegisterDefOperand`, that have too many default parameters. As a result, we have encountered some issues due to the lack of TRI parameters, as shown in issue #82411. Following @RKSimon 's suggestion, this patch refactors 9 functions, including `{reads, kills, defines, modifies}Register`, `registerDefIsDead`, and `findRegister{UseOperandIdx, UseOperand, DefOperandIdx, DefOperand}`, adjusting the order of the TRI parameter and making it required. In addition, all the places that call these functions have also been updated correctly to ensure no additional impact. After this, the caller of these functions should explicitly know whether to pass the `TargetRegisterInfo` or just a `nullptr`.
As noticed by @AtariDreams on #82411, by having the TargetRegisterInfo argument at the end of a long line of optional args, we are often missing it in our function calls and not correctly testing for super reg kill state etc.
ideally we need to refactor the calls so the TRI is no longer optional, so when we don't care about super-registers we explicitly have to set it nullptr.
The text was updated successfully, but these errors were encountered: