2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Spillslot coalescer.
9 * @author Matthias Braun
12 #ifndef FIRM_BE_BESPILLSLOTS_H
13 #define FIRM_BE_BESPILLSLOTS_H
17 typedef struct be_fec_env_t be_fec_env_t;
20 * Initializes a new frame entity coalescer environment
22 be_fec_env_t *be_new_frame_entity_coalescer(ir_graph *irg);
25 * Frees a frame entity coalescer environment
27 void be_free_frame_entity_coalescer(be_fec_env_t *env);
30 * Adds a node that needs a frame entity and consumes memory (Reload nodes). The
31 * memory edges are followed to find memory-phis and the entities that produce
34 * @param env The frame entity coalescer environment
35 * @param node The node that uses the frame entity
36 * @param mode The mode of the needed spillslot
37 * @param align The alignment of the needed spillslot
39 void be_node_needs_frame_entity(be_fec_env_t *env, ir_node *node,
40 const ir_mode *mode, int alignment);
42 typedef void (*set_frame_entity_func)(ir_node *node, ir_entity *entity);
45 * Assigned frame entities to all the nodes added by be_node_needs_frame_entity.
46 * Adds memory perms where needed.
48 void be_assign_entities(be_fec_env_t *env, set_frame_entity_func set_frame,
49 bool alloc_entities_at_begin);