diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-02 14:45:53 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-02 14:45:53 +0000 |
| commit | 232ae7cc209662ef972356972c8e8158f602b735 (patch) | |
| tree | 7d5ad16967cd0eecdb0811386de54af293900c52 | |
| parent | 528a4fa8602cfb7d7e1886a1b08f86046fb9fd5d (diff) | |
| download | bcm5719-llvm-232ae7cc209662ef972356972c8e8158f602b735.tar.gz bcm5719-llvm-232ae7cc209662ef972356972c8e8158f602b735.zip | |
Add TargetRegisterInfo::hasRegUnit().
This trivial helper function tests if a register contains a register
unit. It is similar to regsOverlap(), but with asymmetric arguments.
llvm-svn: 161180
| -rw-r--r-- | llvm/include/llvm/Target/TargetRegisterInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetRegisterInfo.h b/llvm/include/llvm/Target/TargetRegisterInfo.h index a70b8f6cbdb..df4d900e4c8 100644 --- a/llvm/include/llvm/Target/TargetRegisterInfo.h +++ b/llvm/include/llvm/Target/TargetRegisterInfo.h @@ -349,6 +349,14 @@ public: return false; } + /// hasRegUnit - Returns true if Reg contains RegUnit. + bool hasRegUnit(unsigned Reg, unsigned RegUnit) const { + for (MCRegUnitIterator Units(Reg, this); Units.isValid(); ++Units) + if (*Units == RegUnit) + return true; + return false; + } + /// isSubRegister - Returns true if regB is a sub-register of regA. /// bool isSubRegister(unsigned regA, unsigned regB) const { |

