[llvm] 740f920 - LiveRegUnits: Break register loop when a clobber is encountered
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 13 07:15:17 PDT 2022
Author: Matt Arsenault
Date: 2022-09-13T10:15:08-04:00
New Revision: 740f920a1f82f86a7fdb0cf0bd8282696529b0fd
URL: https://github.com/llvm/llvm-project/commit/740f920a1f82f86a7fdb0cf0bd8282696529b0fd
DIFF: https://github.com/llvm/llvm-project/commit/740f920a1f82f86a7fdb0cf0bd8282696529b0fd.diff
LOG: LiveRegUnits: Break register loop when a clobber is encountered
Added:
Modified:
llvm/lib/CodeGen/LiveRegUnits.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/LiveRegUnits.cpp b/llvm/lib/CodeGen/LiveRegUnits.cpp
index 0b20e917e036..34de09dd2944 100644
--- a/llvm/lib/CodeGen/LiveRegUnits.cpp
+++ b/llvm/lib/CodeGen/LiveRegUnits.cpp
@@ -22,8 +22,10 @@ using namespace llvm;
void LiveRegUnits::removeRegsNotPreserved(const uint32_t *RegMask) {
for (unsigned U = 0, E = TRI->getNumRegUnits(); U != E; ++U) {
for (MCRegUnitRootIterator RootReg(U, TRI); RootReg.isValid(); ++RootReg) {
- if (MachineOperand::clobbersPhysReg(RegMask, *RootReg))
+ if (MachineOperand::clobbersPhysReg(RegMask, *RootReg)) {
Units.reset(U);
+ break;
+ }
}
}
}
@@ -31,8 +33,10 @@ void LiveRegUnits::removeRegsNotPreserved(const uint32_t *RegMask) {
void LiveRegUnits::addRegsInMask(const uint32_t *RegMask) {
for (unsigned U = 0, E = TRI->getNumRegUnits(); U != E; ++U) {
for (MCRegUnitRootIterator RootReg(U, TRI); RootReg.isValid(); ++RootReg) {
- if (MachineOperand::clobbersPhysReg(RegMask, *RootReg))
+ if (MachineOperand::clobbersPhysReg(RegMask, *RootReg)) {
Units.set(U);
+ break;
+ }
}
}
}
More information about the llvm-commits
mailing list