diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-21 19:50:05 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-21 19:50:05 +0000 |
commit | a2a98fd0ddd2ae277be7cdd62aae92f6c5155e07 (patch) | |
tree | 1b77ec8fedaf4f4680702ec8dff9bbc2ff660566 /include/llvm/CodeGen/MachineRegisterInfo.h | |
parent | e6949b13997e6d31aa4719a0e80c4b6b405e42a9 (diff) |
Move common code into an MRI function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineRegisterInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 11 |
1 files changed, 10 insertions, 1 deletions
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; } |