Commit d7337be4 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove unused/broken interprocedural view

[r27762]
parent 6eb6226f
......@@ -75,7 +75,6 @@
#include "ident.h"
#include "interval_analysis.h"
#include "irarch.h"
#include "ircgcons.h"
#include "ircgopt.h"
#include "irconsconfirm.h"
#include "ircons.h"
......
......@@ -72,18 +72,6 @@ typedef struct ir_settings_if_conv_t ir_settings_if_conv_t;
/* states */
/** The state of the interprocedural view.
*
* This value indicates the state of the interprocedural view.
*/
typedef enum {
ip_view_no, /**< The interprocedural view is not constructed. There are no
view specific nodes (EndReg, Filter, Break ...) in any graph. */
ip_view_valid, /**< The interprocedural view is valid. */
ip_view_invalid /**< The interprocedural view is invalid. Specific nodes are
all still in the representation, but the graph is no more complete. */
} ip_view_state;
/**
* This function is called, whenever a local variable is used before definition
*
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* Licensees holding valid libFirm Professional Edition licenses may use
* this file in accordance with the libFirm Commercial License.
* Agreement provided with the Software.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
/**
* @file
* @brief Construction and removal of interprocedural representation
* (explicit interprocedural dependencies).
* @author Hubert Schmid
* @date 09.06.2002
* @version $Id$
*/
#ifndef FIRM_IR_IRCGCONS_H
#define FIRM_IR_IRCGCONS_H
#ifdef INTERPROCEDURAL_VIEW
#include "firm_types.h"
#include "begin.h"
/** Return the current state of the interprocedural view. */
FIRM_API ip_view_state get_irp_ip_view_state(void);
/** Set the state of the interprocedural view to invalid. */
FIRM_API void set_irp_ip_view_invalid(void);
/** Construction of the interprocedural view.
*
* Construction of the interprocedural view. A prior analysis must have set
* all possible callees in the corresponding fields of Call nodes. Sets
* ip_view_valid in irp.
*
* @arg free_methods_arr: An array of all free methods, i.e., methods that
* are external visible. These methods get an 'Unknown'
* caller.
* @arg arr_len The number of free methods. */
FIRM_API void cg_construct(int arr_len, ir_entity *free_methods_arr[]);
/** Deconstruction of the interprocedural view. Reduces memory consumption of
the ir. Sets ip_view_no in irp. */
FIRM_API void cg_destruct(void);
#include "end.h"
#endif
#endif
......@@ -409,9 +409,7 @@
* is mature. As other constructors calls optimization and vrfy for the
* block. If one of the predecessors is Unknown (as it has to be filled in
* later) optimizations are skipped. This is necessary to
* construct Blocks in loops. Leaving Unknown in the Block after finishing
* the construction may have strange effects, especially for interprocedural
* representation and analysis.
* construct Blocks in loops.
*
*
* CONTROL FLOW OPERATIONS
......@@ -831,9 +829,7 @@
* of in's of current_block. This is not checked by the library!
* If one of the predecessors is Unknown (as it has to be filled in
* later) optimizations are skipped. This is necessary to
* construct Phi nodes in loops. Leaving Unknown in the Phi after finishing
* the construction may have strange effects, especially for interprocedural
* representation and analysis.
* construct Phi nodes in loops.
*
* Parameter
* arity number of predecessors
......@@ -1190,18 +1186,6 @@ FIRM_API ir_node *new_rd_Jmp(dbg_info *db, ir_node *block);
*/
FIRM_API ir_node *new_rd_IJmp(dbg_info *db, ir_node *block, ir_node *tgt);
/** Constructor for a Break node.
*
* Break represents control flow to a single control successor just as Jmp.
* The blocks separated by a break may not be concatenated by an optimization.
* It is used for the interprocedural representation where blocks are parted
* behind Call nodes to represent the control flow to called procedures.
*
* @param *db A pointer for debug information.
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_rd_Break(dbg_info *db, ir_node *block);
/** Constructor for a Cond node.
*
* If c is mode_b represents a conditional branch (if/else). If c is
......@@ -1891,61 +1875,6 @@ FIRM_API ir_node *new_rd_Confirm(dbg_info *db, ir_node *block,
*/
FIRM_API ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m);
/** Constructor for a CallBegin node.
*
* CallBegin represents control flow depending of the pointer value
* representing the called method to the called methods. The
* constructor copies the method pointer input from the passed Call
* node.
*
* @param *db A pointer for debug information.
* @param *block The block the node belong to.
* @param *ptr pointer to the called function
* @param *call associated call operation
*/
FIRM_API ir_node *new_rd_CallBegin(dbg_info *db, ir_node *block, ir_node *ptr,
ir_node *call);
/** Constructor for a EndReg node.
*
* Used to represent regular procedure end in interprocedual view.
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_rd_EndReg(dbg_info *db, ir_graph *irg, ir_node *block);
/** Constructor for a EndExcept node.
*
* Used to represent exceptional procedure end in interprocedural view.
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_rd_EndExcept(dbg_info *db, ir_graph *irg, ir_node *block);
/** Constructor for a Filter node.
*
* Adds the node to the block in current_ir_block. Filter is a node
* with two views used to construct the interprocedural view. In
* intraprocedural view its semantics are identical to the Proj node.
* In interprocedural view the Filter performs the Phi operation on
* method parameters or results. Other than a Phi a Filter node may
* not be removed if it has only a single input.
*
* The constructor builds the Filter in intraprocedural view.
*
* @param *db A pointer for debug information.
* @param *block The block the node belong to.
* @param *arg The tuple value to project from.
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
FIRM_API ir_node *new_rd_Filter(dbg_info *db,ir_node *block, ir_node *arg,
ir_mode *mode, long proj);
/** Constructor for a Mux node.
*
* @param *db A pointer for debug information.
......@@ -2674,67 +2603,6 @@ FIRM_API ir_node *new_r_Confirm(ir_node *block, ir_node *val, ir_node *bound,
*/
FIRM_API ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m);
/** Constructor for a CallBegin node.
*
* CallBegin represents control flow depending of the pointer value
* representing the called method to the called methods. The
* constructor copies the method pointer input from the passed Call
* node.
*
* @param *block The block the node belong to.
* @param *ptr pointer to the called function
* @param *call associated call operation
*/
FIRM_API ir_node *new_r_CallBegin(ir_node *block, ir_node *ptr, ir_node *call);
/** Constructor for a EndReg node.
*
* Used to represent regular procedure end in interprocedual view.
*
* @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_r_EndReg(ir_graph *irg, ir_node *block);
/** Constructor for a EndExcept node.
*
* Used to represent exceptional procedure end in interprocedural view.
*
* @param *irg The IR graph the node belong to.
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_r_EndExcept(ir_graph *irg, ir_node *block);
/** Constructor for a Break node.
*
* Break represents control flow to a single control successor just as Jmp.
* The blocks separated by a break may not be concatenated by an optimization.
* It is used for the interprocedural representation where blocks are parted
* behind Call nodes to represent the control flow to called procedures.
*
* @param *block The block the node belong to.
*/
FIRM_API ir_node *new_r_Break(ir_node *block);
/** Constructor for a Filter node.
*
* Constructor for a Filter node. Adds the node to the block in current_ir_block.
* Filter is a node with two views used to construct the interprocedural view.
* In intraprocedural view its semantics are identical to the Proj node.
* In interprocedural view the Filter performs the Phi operation on method
* parameters or results. Other than a Phi a Filter node may not be removed
* if it has only a single input.
*
* The constructor builds the Filter in intraprocedural view.
*
* @param *block The block the node belong to.
* @param *arg The tuple value to project from.
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
FIRM_API ir_node *new_r_Filter(ir_node *block, ir_node *arg, ir_mode *mode,
long proj);
/** Constructor for a NoMem node.
*
* Returns the unique NoMem node of the graph. The same as
......@@ -3531,70 +3399,6 @@ FIRM_API ir_node *new_d_Confirm(dbg_info *db, ir_node *val, ir_node *bound,
*/
FIRM_API ir_node *new_d_Unknown(dbg_info *db, ir_mode *m);
/** Constructor for a CallBegin node.
*
* CallBegin represents control flow depending of the pointer value
* representing the called method to the called methods. The
* constructor copies the method pointer input from the passed Call
* node.Adds the node to the block in current_ir_block.
*
* @param *db A pointer for debug information.
* @param *ptr pointer to the called function
* @param *call associated call operation
*/
FIRM_API ir_node *new_d_CallBegin(dbg_info *db, ir_node *ptr, ir_node *call);
/** Constructor for an EndReg node.
*
*Adds the node to the block in current_ir_block.
*
* @param *db A pointer for debug information.
*/
FIRM_API ir_node *new_d_EndReg(dbg_info *db);
/** Constructor for an EndExcept node.
*
* Used to represent regular procedure end in interprocedual view.
* Adds the node to the block in current_ir_block.
*
* @param *db A pointer for debug information.
*/
FIRM_API ir_node *new_d_EndExcept(dbg_info *db);
/** Constructor for a Break node.
*
* Used to represent exceptional procedure end in interprocedural view.
* Adds the node to the block in current_ir_block.
*
* Break represents control flow to a single control successor just as Jmp.
* The blocks separated by a break may not be concatenated by an optimization.
* It is used for the interprocedural representation where blocks are parted
* behind Call nodes to represent the control flow to called procedures.
*
* @param *db A pointer for debug information.
*/
FIRM_API ir_node *new_d_Break(dbg_info *db);
/** Constructor for a Filter node.
*
* Constructor for a Filter node. Adds the node to the block in
* current_ir_block. Filter is a node with two views used to
* construct the interprocedural view. In intraprocedural view its
* semantics are identical to the Proj node. In interprocedural view
* the Filter performs the Phi operation on method parameters or
* results. Other than a Phi a Filter node may not be removed if it
* has only a single input.
*
* The constructor builds the Filter in intraprocedural view.
*
* @param *db A pointer for debug information.
* @param *arg The tuple value to project from.
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
FIRM_API ir_node *new_d_Filter(dbg_info *db, ir_node *arg, ir_mode *mode,
long proj);
/** Constructor for a Mux node.
*
* @param *db A pointer for debug information.
......@@ -3705,20 +3509,6 @@ FIRM_API ir_node *new_Start(void);
*/
FIRM_API ir_node *new_End(void);
/** Constructor for an EndReg node.
*
* Used to represent regular procedure end in interprocedual view.
* Adds the node to the block in current_ir_block.
*/
FIRM_API ir_node *new_EndReg(void);
/** Constructor for an EndExpcept node.
*
* Used to represent exceptional procedure end in interprocedural view.
* Adds the node to the block in current_ir_block.
*/
FIRM_API ir_node *new_EndExcept(void);
/** Constructor for a Jump node.
*
* Adds the node to the block in current_ir_block.
......@@ -3736,15 +3526,6 @@ FIRM_API ir_node *new_Jmp(void);
*/
FIRM_API ir_node *new_IJmp(ir_node *tgt);
/** Constructor for a Break node.
* Break represents control flow to a single control successor just as Jmp.
* The blocks separated by a break may not be concatenated by an optimization.
* It is used for the interprocedural representation where blocks are parted
* behind Call nodes to represent the control flow to called procedures.
* Adds the node to the block in current_ir_block.
*/
FIRM_API ir_node *new_Break(void);
/** Constructor for a Cond node.
*
* If c is mode_b represents a conditional branch (if/else). If c is
......@@ -3936,18 +3717,6 @@ FIRM_API ir_node *new_Call(ir_node *store, ir_node *callee,
FIRM_API ir_node *new_Builtin(ir_node *store, int arity, ir_node *in[],
ir_builtin_kind kind, ir_type *tp);
/** Constructor for a CallBegin node.
*
* CallBegin represents control flow depending of the pointer value
* representing the called method to the called methods. The
* constructor copies the method pointer input from the passed Call
* node. Adds the node to the block in current_ir_block.
*
* @param *ptr pointer to the called function
* @param *call associated call operation
*/
FIRM_API ir_node *new_CallBegin(ir_node *ptr, ir_node *call);
/** Constructor for a Add node.
*
* Adds the node to the block in current_ir_block.
......@@ -4285,23 +4054,6 @@ FIRM_API ir_node *new_Sync(int arity, ir_node *in[]);
*/
FIRM_API ir_node *new_Proj(ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a Filter node.
*
* Constructor for a Filter node. Adds the node to the block in current_ir_block.
* Filter is a node with two views used to construct the interprocedural view.
* In intraprocedural view its semantics are identical to the Proj node.
* In interprocedural view the Filter performs the Phi operation on method
* parameters or results. Other than a Phi a Filter node may not be removed
* if it has only a single input.
*
* The constructor builds the Filter in intraprocedural view.
*
* @param *arg The tuple value to project from.
* @param *mode The mode of the projected value.
* @param proj The position in the tuple to project from.
*/
FIRM_API ir_node *new_Filter(ir_node *arg, ir_mode *mode, long proj);
/** Constructor for a defaultProj node.
*
* Represents the default control flow of a Switch-Cond node.
......
......@@ -324,7 +324,7 @@ typedef enum {
/** if set dumps edges from blocks to their immediate dominator */
ir_dump_flag_dominance = 1U << 9,
/** If set the dumper dumps loop nodes and edges from these nodes to the
* contained ir nodes. Nodes can be missing for interprocedural loops */
* contained ir nodes. */
ir_dump_flag_loops = 1U << 10,
/** if set (and backedge info is computed) dump backedges */
ir_dump_flag_back_edges = 1U << 11,
......
......@@ -122,13 +122,6 @@ FIRM_API ir_graph *current_ir_graph;
FIRM_API ir_graph *get_current_ir_graph(void);
FIRM_API void set_current_ir_graph(ir_graph *graph);
#ifdef INTERPROCEDURAL_VIEW
/** This flag indicate the current view. The behavior of some methods
* (get_irn_*, set_irn_*) is influenced by this flag. */
FIRM_API int get_interprocedural_view(void);
FIRM_API void set_interprocedural_view(int state);
#endif
/**
* Create a new ir graph to build ir for a procedure.
*
......@@ -224,15 +217,6 @@ FIRM_API ir_node *get_irg_end(const ir_graph *irg);
/** Sets the End node of an IR graph. */
FIRM_API void set_irg_end(ir_graph *irg, ir_node *node);
/* The fields end_reg and end_except contain the end nodes of the
interprocedural view. If the view is not constructed they contain
the normal end node. */
FIRM_API ir_node *get_irg_end_reg(const ir_graph *irg);
FIRM_API void set_irg_end_reg(ir_graph *irg, ir_node *node);
FIRM_API ir_node *get_irg_end_except(const ir_graph *irg);
FIRM_API void set_irg_end_except(ir_graph *irg, ir_node *node);
/** Returns the node that represents the initial control flow of the given
* IR graph. */
FIRM_API ir_node *get_irg_initial_exec(const ir_graph *irg);
......
......@@ -74,8 +74,7 @@ FIRM_API void irg_walk_core(ir_node *node, irg_walk_func *pre,
*
* Like irg_walk(), but walks over all reachable nodes in the ir
* graph, starting at the end operation. During the walk current_ir_graph
* is set to irg. Does not use the link field. If interprocedural_view
* is set, visits all reachable irgs.
* is set to irg. Does not use the link field.
*/
FIRM_API void irg_walk_graph(ir_graph *irg, irg_walk_func *pre,
irg_walk_func *post, void *env);
......@@ -114,7 +113,6 @@ FIRM_API void irg_walk_in_or_dep(ir_node *node, irg_walk_func *pre,
* graph, starting at the end operation. During the walk current_ir_graph
* is set to irg. Does not use the link field.
* This walker also follows additional dependency egdes.
* interprocedural_view is not yet supported.
*/
FIRM_API void irg_walk_in_or_dep_graph(ir_graph *irg, irg_walk_func *pre,
irg_walk_func *post, void *env);
......@@ -128,25 +126,10 @@ FIRM_API void irg_walk_in_or_dep_graph(ir_graph *irg, irg_walk_func *pre,
*
* This function executes irg_walk(end, pre, post, env) for all irgraphs in irprog.
* Sets current_ir_graph properly for each walk. Conserves current
* current_ir_graph. In interprocedural view nodes can be visited several
* times. Does not use the link field.
* current_ir_graph. Does not use the link field.
*/
FIRM_API void all_irg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
#ifdef INTERPROCEDURAL_VIEW
/**
* Walks all irgs in interprocedural view.
*
* @param pre walker function, executed before the predecessor of a node are visited
* @param post walker function, executed after the predecessor of a node are visited
* @param env environment, passed to pre and post
*
* This function walks all irgs in interprocedural view.
* Visits each node only once. Sets current_ir_graph properly. Does not use the link field.
*/
FIRM_API void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
#endif
/** Walks only over Block nodes in the graph.
*
* @param node the start node
......@@ -199,7 +182,6 @@ FIRM_API void walk_const_code(irg_walk_func *pre, irg_walk_func *post,
* flag. It marks the node as visited before executing pre.
* The void *env can be used to pass status information between the
* pre and post functions. Does not use the link fields.
* Walks only intraprocedural, even in interprocedural view.
*
* @param irg the irg graph
* @param pre walker function, executed before the predecessor of a node are visited
......@@ -219,7 +201,6 @@ FIRM_API void irg_walk_blkwise_graph(ir_graph *irg, irg_walk_func *pre,
* flag. It marks the node as visited before executing pre.
* The void *env can be used to pass status information between the
* pre and post functions. Does not use the link fields.
* Walks only intraprocedural, even in interprocedural view.
* This walker also follows dependency edges.
*
* @param irg the irg graph
......@@ -242,7 +223,6 @@ FIRM_API void irg_walk_in_or_dep_blkwise_graph(ir_graph *irg,
* flag. It marks the node as visited before executing pre.
* The void *env can be used to pass status information between the
* pre and post functions. Does not use the link fields.
* Walks only intraprocedural, even in interprocedural view.
*
* @param irg the irg graph
* @param pre walker function, executed before the predecessor of a node are visited
......
......@@ -27,7 +27,7 @@
* Computes backedges in the control and data flow.
*
* @note
* Only Block and Phi/Filter nodes can have incoming backedges.
* Only Block and Phi nodes can have incoming backedges.
* Constructs loops data structure: indicates loop nesting.
*/
#ifndef FIRM_ANA_IRLOOP_H
......@@ -41,20 +41,13 @@
/*
* Backedge information.
*
* Predecessors of Block, Phi and interprocedural Filter nodes can
* have backedges. If loop information is computed, this
* information is computed, too.
* Predecessors of Block and Phi nodes can have backedges.
* If loop information is computed, this information is computed, too.
* The backedge information can only be used if the graph is not in
* phase phase_building.
*/
/* ------------------------------------------------------------------- */
#ifdef INTERPROCEDURAL_VIEW
/** Returns true if the predecessor pos is a backedge in the interprocedural view. */
FIRM_API int is_inter_backedge(ir_node *n, int pos);
/** Returns true if the predecessor pos is a backedge in the intraprocedural view. */
FIRM_API int is_intra_backedge(ir_node *n, int pos);
#endif
/** Returns non-zero if the predecessor pos is a backedge. */
FIRM_API int is_backedge(ir_node *n, int pos);
/** Marks edge pos as a backedge. */
......@@ -129,7 +122,7 @@ FIRM_API void *get_loop_link(const ir_loop *loop);
/* Constructing and destructing the loop/backedge information. */
/* ------------------------------------------------------------------- */
/** Constructs backedge information and loop tree for a graph in intraprocedural view.
/** Constructs backedge information and loop tree for a graph.
*
* The algorithm views the program representation as a pure graph.
* It assumes that only block and phi nodes may be loop headers.
......@@ -151,22 +144,6 @@ FIRM_API void *get_loop_link(const ir_loop *loop);
*/
FIRM_API int construct_backedges(ir_graph *irg);
#ifdef INTERPROCEDURAL_VIEW
/** Constructs backedges for all irgs in interprocedural view.
*
* @see As construct_backedges(), but for interprocedural view.
*
* @remark
* All loops in the graph will be marked as such, not only
* realizeable loops and recursions in the program. E.g., if the
* same funcion is called twice, there is a loop between the first
* function return and the second call.
*
* @returns Maximal depth of loop tree.
*/
FIRM_API int construct_ip_backedges(void);
#endif
/**
* Construct Intra-procedural control flow loop tree for a IR-graph.
*
......@@ -192,15 +169,6 @@ FIRM_API int construct_cf_backedges(ir_graph *irg);
*/
FIRM_API void assure_cf_loop(ir_graph *irg);
#ifdef INTERPROCEDURAL_VIEW
/**
* Construct Inter-procedural control flow loop tree.
*
* @see construct_cf_backedges() and construct_ip_backedges().
*/
FIRM_API int construct_ip_cf_backedges(void);
#endif
/**
* Removes all loop information.
* Resets all backedges. Works for any construction algorithm.
......
......@@ -182,8 +182,7 @@ FIRM_API void set_irg_entity_usage_state(ir_graph *irg,
/**
* Assure that the entity usage flags have been computed for the given graph.
*
* This is an intraprocedural analysis that computes the entity usage state
* for all local variables.
* This analysis computes the entity usage state for all local variables.
*
* Note that this is a conservative estimation that by no Firm transformation
* can be invalidated, so it's only recomputed if manually triggered by calling
......
......@@ -81,8 +81,6 @@ FIRM_API int is_ir_node (const void *thing);
* @param node the IR-node
*/
FIRM_API int get_irn_arity (const ir_node *node);
FIRM_API int get_irn_intra_arity(const ir_node *node);
FIRM_API int get_irn_inter_arity(const ir_node *node);
/** Replaces the old in array by a new one that will contain the ins given in
the parameters. Conserves the block predecessor. It copies the array passed.
......@@ -102,7 +100,6 @@ FIRM_API void set_irn_in(ir_node *node, int arity, ir_node *in[]);
/**
* Get the n-th predecessor of a node.
* This function removes Id predecessors.
* This function automatically handles intra- and interprocedural views.
*/
FIRM_API ir_node *get_irn_n(const ir_node *node, int n);
......@@ -150,18 +147,6 @@ FIRM_API ir_node *get_irn_dep(const ir_node *node, int pos);
*/
FIRM_API void set_irn_dep(ir_node *node, int pos, ir_node *dep);
/**
* Get the n-th predecessor of a node in intraprocedural view.
* Can be used always if it's know that node is not a split one.
*/
FIRM_API ir_node *get_irn_intra_n(const ir_node *node, int n);