diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-18 00:50:49 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-18 00:50:49 +0000 |
commit | b4c704877d1600852a55ab7bef2918a7c0af5e0d (patch) | |
tree | 797c8330b51e92939fa6b20a2b45674a8e02d32a /include | |
parent | edb15d6872c4475f45f3182960bd138acda6799e (diff) | |
download | llvm-b4c704877d1600852a55ab7bef2918a7c0af5e0d.tar.gz llvm-b4c704877d1600852a55ab7bef2918a7c0af5e0d.tar.bz2 llvm-b4c704877d1600852a55ab7bef2918a7c0af5e0d.tar.xz |
Provide AltOrders for specifying alternative allocation orders.
A register class can define AltOrders and AltOrderSelect instead of
defining method protos and bodies. The AltOrders lists can be defined
with set operations, and TableGen can verify that the alternative
allocation orders only contain valid registers.
This is currently an opt-in feature, and it is still possible to
override allocation_order_begin/end. That will not be true for long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/Target.td | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 616087cd14..915879202c 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -138,6 +138,22 @@ class RegisterClass<string namespace, list<ValueType> regTypes, int alignment, // overload virtual methods. code MethodProtos = [{}]; code MethodBodies = [{}]; + + // AltOrders - List of alternative allocation orders. The default order is + // MemberList itself, and that is good enough for most targets since the + // register allocators automatically remove reserved registers and move + // callee-saved registers to the end. + list<dag> AltOrders = []; + + // AltOrderSelect - The body of a function that selects the allocation order + // to use in a given machine function. The code will be inserted in a + // function like this: + // + // static inline unsigned f(const MachineFunction &MF) { ... } + // + // The function should return 0 to select the default order defined by + // MemberList, 1 to select the first AltOrders entry and so on. + code AltOrderSelect = [{}]; } // The memberList in a RegisterClass is a dag of set operations. TableGen |