Add a variant of the spillslot coalescing API where you can push the nodes
[libfirm] / ir / be / bespillslots.h
1 /*
2  * Author:      Matthias Braun
3  * Date:                27.7.2006
4  * Copyright:   (c) Universitaet Karlsruhe
5  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  */
7 #ifndef BESPILLSLOTS_H_
8 #define BESPILLSLOTS_H_
9
10 #include "bechordal.h"
11
12 typedef struct _be_fec_env_t be_fec_env_t;
13
14 /**
15  * Initializes a new frame entity coalescer environment
16  */
17 be_fec_env_t *be_new_frame_entity_coalescer(be_irg_t *birg);
18
19 /**
20  * Frees a frame entity coalescer environment
21  */
22 void be_free_frame_entity_coalescer(be_fec_env_t *env);
23
24 /**
25  * Adds a node that needs a frame entity and consumes memory (Reload nodes). The
26  * memory edges are followed to find memory-phis and the entities that produce
27  * the memory values.
28  *
29  * @param env   The frame entity coalescer environment
30  * @param node  The node that uses the frame entity
31  * @param mode  The mode of the needed spillslot
32  * @param align The alignment of the needed spillslot
33  */
34 void be_node_needs_frame_entity(be_fec_env_t *env, ir_node *node,
35                                 const ir_mode *mode, int alignment);
36
37 /**
38  * Assigned frame entities to all the nodes added by be_node_needs_frame_entity.
39  * Adds memory perms where needed.
40  */
41 void be_assign_entities(be_fec_env_t *env);
42
43 //-------------------------------------------------------------------
44 // Old API
45 //-------------------------------------------------------------------
46
47 /**
48  * Assigns frame entities to all spill nodes in the irg.
49  * Coalesces spillslots and minimizes the number of memcopies induced by
50  * memory-phis.
51  */
52 void be_coalesce_spillslots(const be_chordal_env_t *chordal_env);
53
54 #endif