diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-19 16:53:34 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-19 16:53:34 +0000 |
commit | 570f9a972e02830d1ca223743dd6b4cc4fdf9549 (patch) | |
tree | ff67aae70fb2690c391b75f7ec47ff5a4fc5c55c /utils/TableGen/CodeGenRegisters.h | |
parent | a9f65b9a1f57dcf546399ac32bf89d71d20df5b9 (diff) | |
download | llvm-570f9a972e02830d1ca223743dd6b4cc4fdf9549.tar.gz llvm-570f9a972e02830d1ca223743dd6b4cc4fdf9549.tar.bz2 llvm-570f9a972e02830d1ca223743dd6b4cc4fdf9549.tar.xz |
Emit a getMatchingSuperRegClass() implementation for every target.
Use information computed while inferring new register classes to emit
accurate, table-driven implementations of getMatchingSuperRegClass().
Delete the old manual, error-prone implementations in the targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenRegisters.h')
-rw-r--r-- | utils/TableGen/CodeGenRegisters.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index f9d3146c83..1d1454ccf6 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -101,9 +101,16 @@ namespace llvm { // super-class. void inheritProperties(CodeGenRegBank&); - // Map SubRegIndex -> sub-class + // Map SubRegIndex -> sub-class. This is the largest sub-class where all + // registers have a SubRegIndex sub-register. DenseMap<Record*, CodeGenRegisterClass*> SubClassWithSubReg; + // Map SubRegIndex -> set of super-reg classes. This is all register + // classes SuperRC such that: + // + // R:SubRegIndex in this RC for all R in SuperRC. + // + DenseMap<Record*, SmallPtrSet<CodeGenRegisterClass*, 8> > SuperRegClasses; public: unsigned EnumValue; std::string Namespace; @@ -158,6 +165,15 @@ namespace llvm { SubClassWithSubReg[SubIdx] = SubRC; } + // getSuperRegClasses - Returns a bit vector of all register classes + // containing only SubIdx super-registers of this class. + void getSuperRegClasses(Record *SubIdx, BitVector &Out) const; + + // addSuperRegClass - Add a class containing only SudIdx super-registers. + void addSuperRegClass(Record *SubIdx, CodeGenRegisterClass *SuperRC) { + SuperRegClasses[SubIdx].insert(SuperRC); + } + // getSubClasses - Returns a constant BitVector of subclasses indexed by // EnumValue. // The SubClasses vector includs an entry for this class. |