aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2023-05-24 14:57:23 +0100
committerJay Foad <jay.foad@amd.com>2023-06-01 19:17:34 +0100
commit5022fc2ad31b5e3211e2458347c89412b8c5ec1b (patch)
tree3ce4e7d2001a8552c457ae8a0ec1b58fc669f4ae /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent2de54b919ba5fd9ccf37038cddfc36e97eb480af (diff)
downloadllvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.zip
llvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.tar.gz
llvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.tar.bz2
[CodeGen] Make use of MachineInstr::all_defs and all_uses. NFCI.
Differential Revision: https://reviews.llvm.org/D151424
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 6a1d5ee..3d489e3 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -1130,9 +1130,8 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(
if (LV)
for (MachineInstr &MI :
llvm::make_range(getFirstInstrTerminator(), instr_end())) {
- for (MachineOperand &MO : MI.operands()) {
- if (!MO.isReg() || MO.getReg() == 0 || !MO.isUse() || !MO.isKill() ||
- MO.isUndef())
+ for (MachineOperand &MO : MI.all_uses()) {
+ if (MO.getReg() == 0 || !MO.isKill() || MO.isUndef())
continue;
Register Reg = MO.getReg();
if (Reg.isPhysical() || LV->getVarInfo(Reg).removeKill(MI)) {