diff options
author | Jay Foad <jay.foad@amd.com> | 2023-05-24 14:57:23 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-06-01 19:17:34 +0100 |
commit | 5022fc2ad31b5e3211e2458347c89412b8c5ec1b (patch) | |
tree | 3ce4e7d2001a8552c457ae8a0ec1b58fc669f4ae /llvm/lib/CodeGen/BranchFolding.cpp | |
parent | 2de54b919ba5fd9ccf37038cddfc36e97eb480af (diff) | |
download | llvm-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/BranchFolding.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index a5302a6..3830f25 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -1997,8 +1997,8 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) { break; // Remove kills from ActiveDefsSet, these registers had short live ranges. - for (const MachineOperand &MO : TIB->operands()) { - if (!MO.isReg() || !MO.isUse() || !MO.isKill()) + for (const MachineOperand &MO : TIB->all_uses()) { + if (!MO.isKill()) continue; Register Reg = MO.getReg(); if (!Reg) @@ -2015,8 +2015,8 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) { } // Track local defs so we can update liveins. - for (const MachineOperand &MO : TIB->operands()) { - if (!MO.isReg() || !MO.isDef() || MO.isDead()) + for (const MachineOperand &MO : TIB->all_defs()) { + if (MO.isDead()) continue; Register Reg = MO.getReg(); if (!Reg || Reg.isVirtual()) |