libFirm
Loading...
Searching...
No Matches
irloop.h
1/*
2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
4 */
5
18#ifndef FIRM_ANA_IRLOOP_H
19#define FIRM_ANA_IRLOOP_H
20
21#include <stddef.h>
22#include "firm_common.h"
23#include "firm_types.h"
24
25#include "begin.h"
26
33FIRM_API int is_backedge(const ir_node *n, int pos);
35FIRM_API void set_backedge(ir_node *n, int pos);
37FIRM_API int has_backedges(const ir_node *n);
39FIRM_API void clear_backedges(ir_node *n);
40
48
50FIRM_API void set_irg_loop(ir_graph *irg, ir_loop *l);
51
53FIRM_API ir_loop *get_irg_loop(const ir_graph *irg);
54
56FIRM_API ir_loop *get_irn_loop(const ir_node *n);
57
59FIRM_API ir_loop *get_loop_outer_loop(const ir_loop *loop);
61FIRM_API unsigned get_loop_depth(const ir_loop *loop);
62
64FIRM_API size_t get_loop_n_elements(const ir_loop *loop);
65
68FIRM_API loop_element get_loop_element(const ir_loop *loop, size_t pos);
69
73FIRM_API long get_loop_loop_nr(const ir_loop *loop);
74
76FIRM_API void set_loop_link(ir_loop *loop, void *link);
79FIRM_API void *get_loop_link(const ir_loop *loop);
80
95FIRM_API void construct_cf_backedges(ir_graph *irg);
96
102FIRM_API void assure_loopinfo(ir_graph *irg);
103
108FIRM_API void free_loop_information(ir_graph *irg);
109
117FIRM_API int is_loop_invariant(const ir_node *n, const ir_node *block);
118
121#include "end.h"
122
123#endif
firm_kind
A list of firm kinds.
Definition firm_common.h:68
struct ir_graph ir_graph
Procedure Graph.
Definition firm_types.h:74
Loop elements: loop nodes and ir nodes.
Definition irloop.h:42
firm_kind * kind
is either k_ir_node or k_ir_loop
Definition irloop.h:43
ir_graph * irg
Pointer to an ir_graph element (only callgraph loop trees)
Definition irloop.h:46
ir_node * node
Pointer to an ir_node element.
Definition irloop.h:44
ir_loop * son
Pointer to an ir_loop element.
Definition irloop.h:45
void set_irg_loop(ir_graph *irg, ir_loop *l)
Sets the outermost loop in ir graph as basic access to loop tree.
void * get_loop_link(const ir_loop *loop)
Returns field with additional loop information.
long get_loop_loop_nr(const ir_loop *loop)
Returns a unique node number for the loop node to make output readable.
ir_loop * get_irn_loop(const ir_node *n)
Returns the loop n is contained in.
loop_element get_loop_element(const ir_loop *loop, size_t pos)
Returns a loop element.
void clear_backedges(ir_node *n)
Clears all backedge information.
void set_backedge(ir_node *n, int pos)
Marks edge pos as a backedge.
ir_loop * get_irg_loop(const ir_graph *irg)
Returns the root loop info (if exists) for an irg.
int is_loop_invariant(const ir_node *n, const ir_node *block)
Tests whether a value is loop invariant.
void assure_loopinfo(ir_graph *irg)
Computes Intra-procedural control flow loop tree on demand.
int is_backedge(const ir_node *n, int pos)
Returns non-zero if the predecessor pos is a backedge.
void set_loop_link(ir_loop *loop, void *link)
A field to connect additional information to a loop.
size_t get_loop_n_elements(const ir_loop *loop)
Returns the number of elements contained in loop.
struct ir_loop ir_loop
Loop.
Definition firm_types.h:80
unsigned get_loop_depth(const ir_loop *loop)
Returns nesting depth of this loop.
void construct_cf_backedges(ir_graph *irg)
Construct Intra-procedural control flow loop tree for a IR-graph.
ir_loop * get_loop_outer_loop(const ir_loop *loop)
Returns outer loop, itself if outermost.
int has_backedges(const ir_node *n)
Returns non-zero if n has backedges.
void free_loop_information(ir_graph *irg)
Removes all loop information.
struct ir_node ir_node
Procedure Graph Node.
Definition firm_types.h:53