From a2a98fd0ddd2ae277be7cdd62aae92f6c5155e07 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 21 Dec 2011 19:50:05 +0000 Subject: Move common code into an MRI function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147071 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineRegisterInfo.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/llvm/CodeGen') diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index bd674d2b96..773683a748 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -283,7 +283,16 @@ public: /// isPhysRegUsed - Return true if the specified register is used in this /// function. This only works after register allocation. bool isPhysRegUsed(unsigned Reg) const { return UsedPhysRegs[Reg]; } - + + /// isPhysRegOrOverlapUsed - Return true if Reg or any overlapping register + /// is used in this function. + bool isPhysRegOrOverlapUsed(unsigned Reg) const { + for (const unsigned *AI = TRI->getOverlaps(Reg); *AI; ++AI) + if (isPhysRegUsed(*AI)) + return true; + return false; + } + /// setPhysRegUsed - Mark the specified register used in this function. /// This should only be called during and after register allocation. void setPhysRegUsed(unsigned Reg) { UsedPhysRegs[Reg] = true; } -- cgit v1.2.3-70-g09d2