diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-01 22:38:17 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-01 22:38:17 +0000 |
commit | 9b09cf0c11783cf479ed70cdf060d8e147ab488f (patch) | |
tree | 39ef76321c85b3a9094f9f2e7cf8e028f5268f2d /llvm/lib/CodeGen/RegAllocFast.cpp | |
parent | 573649eb8bc39647e54e8940b0475e9191fc188c (diff) | |
download | llvm-9b09cf0c11783cf479ed70cdf060d8e147ab488f.zip llvm-9b09cf0c11783cf479ed70cdf060d8e147ab488f.tar.gz llvm-9b09cf0c11783cf479ed70cdf060d8e147ab488f.tar.bz2 |
Simplify some more getAliasSet callers.
MCRegAliasIterator can include Reg itself in the list.
llvm-svn: 157848
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocFast.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp index b383222..8a22e63 100644 --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/lib/CodeGen/RegAllocFast.cpp @@ -711,13 +711,10 @@ void RAFast::handleThroughOperands(MachineInstr *MI, if (!MO.isReg() || !MO.isDef()) continue; unsigned Reg = MO.getReg(); if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; - UsedInInstr.set(Reg); - if (ThroughRegs.count(PhysRegState[Reg])) - definePhysReg(MI, Reg, regFree); - for (const uint16_t *AS = TRI->getAliasSet(Reg); *AS; ++AS) { - UsedInInstr.set(*AS); - if (ThroughRegs.count(PhysRegState[*AS])) - definePhysReg(MI, *AS, regFree); + for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) { + UsedInInstr.set(*AI); + if (ThroughRegs.count(PhysRegState[*AI])) + definePhysReg(MI, *AI, regFree); } } @@ -1036,9 +1033,8 @@ void RAFast::AllocateBasicBlock() { if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; // Look for physreg defs and tied uses. if (!MO.isDef() && !MI->isRegTiedToDefOperand(i)) continue; - UsedInInstr.set(Reg); - for (const uint16_t *AS = TRI->getAliasSet(Reg); *AS; ++AS) - UsedInInstr.set(*AS); + for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) + UsedInInstr.set(*AI); } } |