diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-09-11 16:34:08 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-09-11 16:34:08 +0000 |
commit | d346d4871a38c7aa99ddd2a3e6e183419d8e37d2 (patch) | |
tree | 6980d5cae13d6eb422c9e2b0aedece861395d69f /llvm/utils/TableGen/CodeGenRegisters.h | |
parent | dd40fda52d1a355d3c5cf366a32b5e8d938b43d7 (diff) | |
download | bcm5719-llvm-d346d4871a38c7aa99ddd2a3e6e183419d8e37d2.tar.gz bcm5719-llvm-d346d4871a38c7aa99ddd2a3e6e183419d8e37d2.zip |
Add TRI::getSubRegIndexLaneMask().
Sub-register lane masks are bitmasks that can be used to determine if
two sub-registers of a virtual register will overlap. For example, ARM's
ssub0 and ssub1 sub-register indices don't overlap each other, but both
overlap dsub0 and qsub0.
The lane masks will be accurate on most targets, but on targets that use
sub-register indexes in an irregular way, the masks may conservatively
report that two sub-register indices overlap when the eventually
allocated physregs don't.
Irregular register banks also mean that the bits in a lane mask can't be
mapped onto register units, but the concept is similar.
llvm-svn: 163630
Diffstat (limited to 'llvm/utils/TableGen/CodeGenRegisters.h')
-rw-r--r-- | llvm/utils/TableGen/CodeGenRegisters.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenRegisters.h b/llvm/utils/TableGen/CodeGenRegisters.h index 72b6196038f..bd748ca62e1 100644 --- a/llvm/utils/TableGen/CodeGenRegisters.h +++ b/llvm/utils/TableGen/CodeGenRegisters.h @@ -40,6 +40,7 @@ namespace llvm { public: const unsigned EnumValue; + unsigned LaneMask; CodeGenSubRegIndex(Record *R, unsigned Enum); CodeGenSubRegIndex(StringRef N, StringRef Nspace, unsigned Enum); @@ -83,6 +84,9 @@ namespace llvm { // Return the map of composites. const CompMap &getComposites() const { return Composed; } + // Compute LaneMask from Composed. Return LaneMask. + unsigned computeLaneMask(); + private: CompMap Composed; }; @@ -486,6 +490,9 @@ namespace llvm { // Populate the Composite map from sub-register relationships. void computeComposites(); + // Compute a lane mask for each sub-register index. + void computeSubRegIndexLaneMasks(); + public: CodeGenRegBank(RecordKeeper&); |