diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-16 16:39:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-16 16:39:14 +0000 |
commit | 00032bf6cc236b1fb534f74b1ac288f611a86804 (patch) | |
tree | f9d2e52e3cdaad0cc29f778948519fba0a61d91a /include/llvm/Target | |
parent | 439a27ac425cb9e3f3947268e268c22b78b7e7cd (diff) | |
download | llvm-00032bf6cc236b1fb534f74b1ac288f611a86804.tar.gz llvm-00032bf6cc236b1fb534f74b1ac288f611a86804.tar.bz2 llvm-00032bf6cc236b1fb534f74b1ac288f611a86804.tar.xz |
Add support for register alias set description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/MRegisterInfo.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index 107adc3c31..2939b59ca1 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -16,12 +16,16 @@ class Type; class MachineFunction; /// MRegisterDesc - This record contains all of the information known about a -/// particular register. +/// particular register. The AliasSet field (if not null) contains a pointer to +/// a Zero terminated array of registers that this register aliases. This is +/// needed for architectures like X86 which have AL alias AX alias EAX. +/// Registers that this does not apply to simply should set this to null. /// struct MRegisterDesc { - const char *Name; // Assembly language name for the register - unsigned Flags; // Flags identifying register properties (defined below) - unsigned TSFlags; // Target Specific Flags + const char *Name; // Assembly language name for the register + const unsigned *AliasSet; // Register Alias Set, described above + unsigned Flags; // Flags identifying register properties (below) + unsigned TSFlags; // Target Specific Flags }; /// MRF namespace - This namespace contains flags that pertain to machine @@ -88,7 +92,7 @@ public: /// produce a value. Some frontends may use this as an operand register to /// mean special things, for example, the Sparc backend uses R0 to mean %g0 /// which always PRODUCES the value 0. The X86 backend does not use this - /// value as an operand register. + /// value as an operand register, except for memory references. /// NoRegister = 0, @@ -111,6 +115,13 @@ public: /// const MRegisterDesc &get(unsigned RegNo) const { return operator[](RegNo); } + /// getAliasSet - Return the set of registers aliased by the specified + /// register, or a null list of there are none. The list returned is zero + /// terminated. + /// + const unsigned *getAliasSet(unsigned RegNo) const { + return get(RegNo).AliasSet; + } virtual MachineBasicBlock::iterator storeReg2RegOffset(MachineBasicBlock &MBB, |