2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Implementation of the RA-Interface for an external, (non-SSA) register allocator.
23 * @author Daniel Grund
27 * The external register allocator is a program:
28 * PROG -i INPUTFILE -o OUTPUTFILE
30 * 1) Input file defines the interference graph
31 * 2) Output file contains the instructions to perform
36 ----------------------
38 inputfile ::= regs nodes interf affinities .
40 regs ::= 'regs' regcount . // Anzahl der register (0..regcount-1), die zur Verfuegung stehen
42 nodes ::= 'nodes' '{' node* '}' . // All nodes in the graph
45 | node-info '<' reg-nr '>' . // Reg-nr is present in case of constraints
47 node-info ::= node-nr spill-costs .
49 interf ::= 'interferences' '{' i-edge* '}' . // Interference edges of the graph
51 i-edge ::= '(' node-nr ',' node-nr ')' .
53 affinities ::= 'affinities' '{' a-edge* '}' . // Affinity edges of the graph
55 a-edge ::= '(' node-nr ',' node-nr ',' weight ')' .
58 weight, regcount, node-nr ::= int32 .
59 spill-costs ::= int32 . // negative spill costs indicate unspillable
61 The output file format
62 -----------------------
64 outputfile ::= spills | allocs .
66 spills ::= 'spills' node-nr+ .
68 allocs ::= 'allocs' alloc* .
70 alloc ::= node-nr reg-nr .
74 #ifndef FIRM_BE_BERAEXTERN_H
75 #define FIRM_BE_BERAEXTERN_H
79 #endif /* FIRM_BE_BERAEXTERN_H */