2 * Author: Matthias Braun
4 * Copyright: (c) Universitaet Karlsruhe
5 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
7 #ifndef BESPILLSLOTS_H_
8 #define BESPILLSLOTS_H_
10 #include "bechordal.h"
12 typedef struct _be_fec_env_t be_fec_env_t;
15 * Initializes a new frame entity coalescer environment
17 be_fec_env_t *be_new_frame_entity_coalescer(be_irg_t *birg);
20 * Frees a frame entity coalescer environment
22 void be_free_frame_entity_coalescer(be_fec_env_t *env);
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
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
34 void be_node_needs_frame_entity(be_fec_env_t *env, ir_node *node,
35 const ir_mode *mode, int alignment);
38 * Assigned frame entities to all the nodes added by be_node_needs_frame_entity.
39 * Adds memory perms where needed.
41 void be_assign_entities(be_fec_env_t *env);
43 //-------------------------------------------------------------------
45 //-------------------------------------------------------------------
48 * Assigns frame entities to all spill nodes in the irg.
49 * Coalesces spillslots and minimizes the number of memcopies induced by
52 void be_coalesce_spillslots(const be_chordal_env_t *chordal_env);