2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Construction of Confirm nodes
12 #ifndef FIRM_ANA_IRCONSCONFIRM_H
13 #define FIRM_ANA_IRCONSCONFIRM_H
15 #include "firm_types.h"
19 * Inject Confirm nodes into a graph.
21 * @param irg the graph
23 * Confirm nodes carry confirmation information, such as
24 * a relation between a value a and another value (or a constant)
27 * These allows to do some range dependent optimizations for Cmp,
28 * Abs, Min, Max nodes as well as bounds checking deletion.
30 * The heap analysis might profit also. On the other side, Confirm
31 * nodes disturb local optimizations, because patterns are destroyed.
33 * It is possible to avoid this by skipping Confirm nodes, but this
34 * is not implemented and is not cheap. The same happens with Casts
35 * nodes too. The current solution is to remove Confirms at a later
38 FIRM_API void construct_confirms(ir_graph *irg);
41 * Creates an ir_graph pass for construct_confirms().
43 * @param name the name of this pass or NULL
45 * @return the newly created ir_graph pass
47 FIRM_API ir_graph_pass_t *construct_confirms_pass(const char *name);
50 * Remove all Confirm nodes from a graph.
52 * Note that local_optimize() can handle this if
53 * the remove Confirm node setting is on (set_opt_remove_Confirm(1)).
55 FIRM_API void remove_confirms(ir_graph *irg);
58 * Creates an ir_graph pass for remove_confirms().
60 * @param name the name of this pass or NULL
62 * @return the newly created ir_graph pass
64 FIRM_API ir_graph_pass_t *remove_confirms_pass(const char *name);