diff options
author | Xu Zhang <simonzgx@gmail.com> | 2024-04-24 21:24:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 14:24:14 +0100 |
commit | f6d431f208c0fa48827eac40e7acf788346a9967 (patch) | |
tree | 1ef7233cbc4728923cd3cfafa05f8bbbdaee95f4 /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | 07e6c1609d0a57f7ddc0537b7794be2e0296658b (diff) | |
download | llvm-f6d431f208c0fa48827eac40e7acf788346a9967.zip llvm-f6d431f208c0fa48827eac40e7acf788346a9967.tar.gz llvm-f6d431f208c0fa48827eac40e7acf788346a9967.tar.bz2 |
[CodeGen] Make the parameter TRI required in some functions. (#85968)
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`.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 26a8d00..42cdcaa 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -709,7 +709,7 @@ bool MachineCSE::ProcessBlockCSE(MachineBasicBlock *MBB) { for (MachineBasicBlock::iterator II = CSMI, IE = &MI; II != IE; ++II) for (auto ImplicitDef : ImplicitDefs) if (MachineOperand *MO = II->findRegisterUseOperand( - ImplicitDef, /*isKill=*/true, TRI)) + ImplicitDef, TRI, /*isKill=*/true)) MO->setIsKill(false); } else { // If the instructions aren't in the same BB, bail out and clear the |