Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
3e62d208
Commit
3e62d208
authored
Jul 19, 2015
by
Christoph Mallon
Browse files
Remove unused copy statistics.
parent
6e8e5296
Changes
13
Hide whitespace changes
Inline
Side-by-side
ir/Makefile.am
View file @
3e62d208
...
...
@@ -72,7 +72,6 @@ libfirm_la_SOURCES = \
be/becopyilp2.c
\
be/becopyilp.c
\
be/becopyopt.c
\
be/becopystat.c
\
be/bedump.c
\
be/bedwarf.c
\
be/beemitter_binary.c
\
...
...
@@ -275,7 +274,6 @@ EXTRA_DIST = \
be/beabihelper.h
\
be/becopyilp_t.h
\
be/becopyopt.h
\
be/becopystat.h
\
be/bedump.h
\
be/belive.h
\
be/beintlive_t.h
\
...
...
ir/be/bechordal_main.c
View file @
3e62d208
...
...
@@ -50,8 +50,6 @@
#include "bespill.h"
#include "bespillutil.h"
#include "belower.h"
#include "becopystat.h"
#include "becopyopt.h"
#include "bessadestr.h"
#include "beverify.h"
...
...
ir/be/becopyilp2.c
View file @
3e62d208
...
...
@@ -563,14 +563,6 @@ static void ilp2_apply(ilp_env_t *ienv)
free
(
sol
);
}
#ifdef COPYOPT_STAT
/* TODO adapt to multiple possible ILPs */
copystat_add_ilp_time
((
int
)(
1000
.
0
*
lpp_get_sol_time
(
pi
->
curr_lp
)));
//now we have ms
copystat_add_ilp_vars
(
lpp_get_var_count
(
pi
->
curr_lp
));
copystat_add_ilp_csts
(
lpp_get_cst_count
(
pi
->
curr_lp
));
copystat_add_ilp_iter
(
lpp_get_iter_cnt
(
pi
->
curr_lp
));
#endif
}
/**
...
...
ir/be/becopyopt.c
View file @
3e62d208
...
...
@@ -32,7 +32,6 @@
#include "bearch.h"
#include "becopyopt_t.h"
#include "becopystat.h"
#include "bedump.h"
#include "beifg.h"
#include "beinsn_t.h"
...
...
ir/be/becopystat.c
deleted
100644 → 0
View file @
6e8e5296
/*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Copy node statistics.
* @author Daniel Grund
* @date 19.04.2005
*/
#include <string.h>
#include "debug.h"
#include "timing.h"
#include "irgwalk.h"
#include "irprog.h"
#include "iredges_t.h"
#include "irnodeset.h"
#include "bechordal_t.h"
#include "bediagnostic.h"
#include "benode.h"
#include "becopyopt_t.h"
#include "becopystat.h"
#include "bemodule.h"
#include "belive.h"
#define DEBUG_LVL SET_LEVEL_1
DEBUG_ONLY
(
static
firm_dbg_module_t
*
dbg
=
NULL
;)
#define MAX_ARITY 20
#define MAX_CLS_SIZE 20
#define MAX_CLS_PHIS 20
/**
* For an explanation of these values see the code of copystat_dump_pretty
*/
enum
vals_t
{
/* FROM HERE: PROBLEM CHARACTERIZATION */
I_ALL_NODES
=
0
,
I_BLOCKS
,
/* phi nodes */
I_PHI_CNT
,
/* number of phi nodes */
I_PHI_ARG_CNT
,
/* number of arguments of phis */
I_PHI_ARG_SELF
,
/* number of arguments of phis being the phi itself */
I_PHI_ARG_CONST
,
/* number of arguments of phis being consts */
I_PHI_ARG_PRED
,
/* ... being defined in a cf-pred */
I_PHI_ARG_GLOB
,
/* ... being defined elsewhere */
I_PHI_ARITY_S
,
I_PHI_ARITY_E
=
I_PHI_ARITY_S
+
MAX_ARITY
,
/* copy nodes */
I_CPY_CNT
,
/* number of copynodes */
/* phi classes */
I_CLS_CNT
,
/* number of phi classes */
I_CLS_IF_FREE
,
/* number of pc having no interference */
I_CLS_IF_MAX
,
/* number of possible interferences in all classes */
I_CLS_IF_CNT
,
/* number of actual interferences in all classes */
I_CLS_SIZE_S
,
I_CLS_SIZE_E
=
I_CLS_SIZE_S
+
MAX_CLS_SIZE
,
I_CLS_PHIS_S
,
I_CLS_PHIS_E
=
I_CLS_PHIS_S
+
MAX_CLS_PHIS
,
/* FROM HERE: RESULT VLAUES */
/* all of them are external set */
/* ilp values */
I_HEUR_TIME
,
/* solving time in milli seconds */
I_ILP_TIME
,
/* solving time in milli seconds */
I_ILP_VARS
,
I_ILP_CSTR
,
I_ILP_ITER
,
/* number of simplex iterations */
/* copy instructions */
I_COPIES_MAX
,
/* max possible costs of copies*/
I_COPIES_INIT
,
/* number of copies in initial allocation */
I_COPIES_HEUR
,
/* number of copies after heuristic */
I_COPIES_5SEC
,
/* number of copies after ilp with max n sec */
I_COPIES_30SEC
,
/* number of copies after ilp with max n sec */
I_COPIES_OPT
,
/* number of copies after ilp */
I_COPIES_IF
,
/* number of copies inevitable due to root-arg-interf */
ASIZE
};
/**
* Holds current values. Values are added till next copystat_reset
*/
static
int
curr_vals
[
ASIZE
];
static
ir_nodeset_t
*
all_phi_nodes
;
static
ir_nodeset_t
*
all_copy_nodes
;
BE_REGISTER_MODULE_CONSTRUCTOR
(
be_init_copystat
)
void
be_init_copystat
(
void
)
{
FIRM_DBG_REGISTER
(
dbg
,
"firm.be.copystat"
);
all_phi_nodes
=
ir_nodeset_new
(
64
);
all_copy_nodes
=
ir_nodeset_new
(
64
);
memset
(
curr_vals
,
0
,
sizeof
(
curr_vals
));
}
BE_REGISTER_MODULE_DESTRUCTOR
(
be_quit_copystat
)
void
be_quit_copystat
(
void
)
{
if
(
all_phi_nodes
!=
NULL
)
{
ir_nodeset_del
(
all_phi_nodes
);
all_phi_nodes
=
NULL
;
}
if
(
all_copy_nodes
!=
NULL
)
{
ir_nodeset_del
(
all_copy_nodes
);
all_copy_nodes
=
NULL
;
}
}
void
copystat_add_max_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_MAX
]
+=
costs
;
}
void
copystat_add_inevit_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_IF
]
+=
costs
;
}
void
copystat_add_init_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_INIT
]
+=
costs
;
}
void
copystat_add_heur_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_HEUR
]
+=
costs
;
}
void
copystat_add_opt_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_OPT
]
+=
costs
;
}
void
copystat_add_heur_time
(
int
time
)
{
curr_vals
[
I_HEUR_TIME
]
+=
time
;
}
void
copystat_add_ilp_5_sec_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_5SEC
]
+=
costs
;
}
void
copystat_add_ilp_30_sec_costs
(
int
costs
)
{
curr_vals
[
I_COPIES_30SEC
]
+=
costs
;
}
void
copystat_add_ilp_time
(
int
time
)
{
curr_vals
[
I_ILP_TIME
]
+=
time
;
}
void
copystat_add_ilp_vars
(
int
vars
)
{
curr_vals
[
I_ILP_VARS
]
+=
vars
;
}
void
copystat_add_ilp_csts
(
int
csts
)
{
curr_vals
[
I_ILP_CSTR
]
+=
csts
;
}
void
copystat_add_ilp_iter
(
int
iters
)
{
curr_vals
[
I_ILP_ITER
]
+=
iters
;
}
/**
* Opens a file named base.ext with the mode mode.
*/
static
FILE
*
be_ffopen
(
const
char
*
base
,
const
char
*
ext
,
const
char
*
mode
)
{
FILE
*
out
;
char
buf
[
1024
];
snprintf
(
buf
,
sizeof
(
buf
),
"%s.%s"
,
base
,
ext
);
buf
[
sizeof
(
buf
)
-
1
]
=
'\0'
;
if
(
!
(
out
=
fopen
(
buf
,
mode
)))
{
be_errorf
(
NULL
,
"cannot open file '%s' in mode '%s'"
,
buf
,
mode
);
return
NULL
;
}
return
out
;
}
void
copystat_dump
(
ir_graph
*
irg
)
{
int
i
;
char
buf
[
1024
];
FILE
*
out
;
snprintf
(
buf
,
sizeof
(
buf
),
"%s__%s"
,
get_irp_name
(),
get_entity_name
(
get_irg_entity
(
irg
)));
buf
[
sizeof
(
buf
)
-
1
]
=
'\0'
;
out
=
be_ffopen
(
buf
,
"stat"
,
"wt"
);
fprintf
(
out
,
"%d
\n
"
,
(
int
)
ASIZE
);
for
(
i
=
0
;
i
<
ASIZE
;
i
++
)
{
fprintf
(
out
,
"%i
\n
"
,
curr_vals
[
i
]);
}
fclose
(
out
);
}
void
copystat_dump_pretty
(
ir_graph
*
irg
)
{
int
i
;
char
buf
[
1024
];
FILE
*
out
;
snprintf
(
buf
,
sizeof
(
buf
),
"%s__%s"
,
get_irp_name
(),
get_entity_name
(
get_irg_entity
(
irg
)));
buf
[
sizeof
(
buf
)
-
1
]
=
'\0'
;
out
=
be_ffopen
(
buf
,
"pstat"
,
"wt"
);
fprintf
(
out
,
"Nodes %4d
\n
"
,
curr_vals
[
I_ALL_NODES
]);
fprintf
(
out
,
"Blocks %4d
\n
"
,
curr_vals
[
I_BLOCKS
]);
fprintf
(
out
,
"CopyIrn %4d
\n
"
,
curr_vals
[
I_CPY_CNT
]);
fprintf
(
out
,
"
\n
Phis %4d
\n
"
,
curr_vals
[
I_PHI_CNT
]);
fprintf
(
out
,
"... argument types
\n
"
);
fprintf
(
out
,
" Total %4d
\n
"
,
curr_vals
[
I_PHI_ARG_CNT
]);
fprintf
(
out
,
" Self %4d
\n
"
,
curr_vals
[
I_PHI_ARG_SELF
]);
fprintf
(
out
,
" Constants %4d
\n
"
,
curr_vals
[
I_PHI_ARG_CONST
]);
fprintf
(
out
,
" CF-Pred %4d
\n
"
,
curr_vals
[
I_PHI_ARG_PRED
]);
fprintf
(
out
,
" Others %4d
\n
"
,
curr_vals
[
I_PHI_ARG_GLOB
]);
fprintf
(
out
,
"... arities
\n
"
);
for
(
i
=
I_PHI_ARITY_S
;
i
<=
I_PHI_ARITY_E
;
i
++
)
fprintf
(
out
,
" %2i %4d
\n
"
,
i
-
I_PHI_ARITY_S
,
curr_vals
[
i
]);
fprintf
(
out
,
"
\n
Phi classes %4d
\n
"
,
curr_vals
[
I_CLS_CNT
]);
fprintf
(
out
,
" compl. free %4d
\n
"
,
curr_vals
[
I_CLS_IF_FREE
]);
fprintf
(
out
,
" inner intf. %4d / %4d
\n
"
,
curr_vals
[
I_CLS_IF_CNT
],
curr_vals
[
I_CLS_IF_MAX
]);
fprintf
(
out
,
"... sizes
\n
"
);
for
(
i
=
I_CLS_SIZE_S
;
i
<=
I_CLS_SIZE_E
;
i
++
)
fprintf
(
out
,
" %2i %4d
\n
"
,
i
-
I_CLS_SIZE_S
,
curr_vals
[
i
]);
fprintf
(
out
,
"... contained phis
\n
"
);
for
(
i
=
I_CLS_PHIS_S
;
i
<=
I_CLS_PHIS_E
;
i
++
)
fprintf
(
out
,
" %2i %4d
\n
"
,
i
-
I_CLS_PHIS_S
,
curr_vals
[
i
]);
fprintf
(
out
,
"
\n
ILP stat
\n
"
);
fprintf
(
out
,
" Time %8d
\n
"
,
curr_vals
[
I_ILP_TIME
]);
fprintf
(
out
,
" Iter %8d
\n
"
,
curr_vals
[
I_ILP_ITER
]);
fprintf
(
out
,
"
\n
Copy stat
\n
"
);
fprintf
(
out
,
" Max %4d
\n
"
,
curr_vals
[
I_COPIES_MAX
]);
fprintf
(
out
,
" Init %4d
\n
"
,
curr_vals
[
I_COPIES_INIT
]);
fprintf
(
out
,
" Heur %4d
\n
"
,
curr_vals
[
I_COPIES_HEUR
]);
fprintf
(
out
,
" Opt %4d
\n
"
,
curr_vals
[
I_COPIES_OPT
]);
fprintf
(
out
,
" Intf %4d
\n
"
,
curr_vals
[
I_COPIES_IF
]);
fclose
(
out
);
}
ir/be/becopystat.h
deleted
100644 → 0
View file @
6e8e5296
/*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Copy node statistics.
* @author Daniel Grund
* @date 11.04.2005
*/
#ifndef FIRM_BE_BECOPYSTAT_H
#define FIRM_BE_BECOPYSTAT_H
#include "firm_types.h"
#include "bearch.h"
#include "bechordal_t.h"
void
copystat_add_max_costs
(
int
costs
);
void
copystat_add_inevit_costs
(
int
costs
);
void
copystat_add_init_costs
(
int
costs
);
void
copystat_add_heur_costs
(
int
costs
);
void
copystat_add_opt_costs
(
int
costs
);
void
copystat_add_heur_time
(
int
time
);
void
copystat_dump
(
ir_graph
*
irg
);
void
copystat_dump_pretty
(
ir_graph
*
irg
);
void
copystat_add_ilp_5_sec_costs
(
int
costs
);
void
copystat_add_ilp_30_sec_costs
(
int
costs
);
void
copystat_add_ilp_time
(
int
time
);
void
copystat_add_ilp_vars
(
int
vars
);
void
copystat_add_ilp_csts
(
int
csts
);
void
copystat_add_ilp_iter
(
int
iters
);
#endif
ir/be/beifg.c
View file @
3e62d208
...
...
@@ -11,6 +11,7 @@
*/
#include <stdlib.h>
#include "bechordal_t.h"
#include "lc_opts.h"
#include "lc_opts_enum.h"
...
...
@@ -20,8 +21,6 @@
#include "irnode_t.h"
#include "beifg.h"
#include "xmalloc.h"
#include "becopystat.h"
#include "beirg.h"
#include "bemodule.h"
#include "belive.h"
...
...
ir/be/bemain.c
View file @
3e62d208
...
...
@@ -46,7 +46,6 @@
#include "bera.h"
#include "bechordal_t.h"
#include "beifg.h"
#include "becopystat.h"
#include "bessadestr.h"
#include "belower.h"
#include "bespillutil.h"
...
...
ir/be/bemodule.c
View file @
3e62d208
...
...
@@ -38,7 +38,6 @@ void be_init_copyilp(void);
void
be_init_copyilp2
(
void
);
void
be_init_copynone
(
void
);
void
be_init_copyopt
(
void
);
void
be_init_copystat
(
void
);
void
be_init_daemelspill
(
void
);
void
be_init_dwarf
(
void
);
void
be_init_gas
(
void
);
...
...
@@ -61,7 +60,6 @@ void be_init_spillslots(void);
void
be_init_ssaconstr
(
void
);
void
be_init_state
(
void
);
void
be_quit_copystat
(
void
);
void
be_quit_pbqp
(
void
);
/**
...
...
@@ -78,7 +76,6 @@ void be_init_modules(void)
be_init_blocksched
();
be_init_chordal_common
();
be_init_copyopt
();
be_init_copystat
();
be_init_dwarf
();
be_init_gas
();
be_init_live
();
...
...
@@ -125,7 +122,6 @@ void be_init_modules(void)
void
be_quit_modules
(
void
)
{
be_quit_copystat
();
#ifdef FIRM_GRGEN_BE
be_quit_pbqp
();
#endif
...
...
ir/lpp/lpp.h
View file @
3e62d208
...
...
@@ -291,16 +291,6 @@ static inline lpp_sol_state_t lpp_get_sol_state(const lpp_t *lpp)
return
lpp
->
sol_state
;
}
static
inline
int
lpp_get_var_count
(
const
lpp_t
*
lpp
)
{
return
lpp
->
var_next
-
1
;
}
static
inline
int
lpp_get_cst_count
(
const
lpp_t
*
lpp
)
{
return
lpp
->
cst_next
-
1
;
}
static
inline
double
lpp_get_var_sol
(
const
lpp_t
*
lpp
,
int
idx
)
{
return
lpp
->
vars
[
idx
]
->
value
;
...
...
win32/libfirm.dsp
View file @
3e62d208
...
...
@@ -1290,14 +1290,6 @@ SOURCE=..\ir\be\becopyopt_t.h
# End Source File
# Begin Source File
SOURCE=..\ir\be\becopystat.c
# End Source File
# Begin Source File
SOURCE=..\ir\be\becopystat.h
# End Source File
# Begin Source File
SOURCE=..\ir\be\bedbgout.c
# End Source File
# Begin Source File
...
...
win32/vc2010/firm.vcxproj
View file @
3e62d208
...
...
@@ -182,7 +182,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedump_minir.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bemodule.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\beloopana.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopystat.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedbgout.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedomfront.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bepeephole.c"
/>
...
...
@@ -243,7 +242,6 @@
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyilp_t.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyopt.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyopt_t.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopystat.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\bedomfront.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\bedump_minir.h"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\be\beemitter.h"
/>
...
...
win32/vc2010/firm.vcxproj.filters
View file @
3e62d208
...
...
@@ -285,9 +285,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopypbqp.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopystat.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedbgout.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
...
...
@@ -483,9 +480,6 @@
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopypbqp.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopystat.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\be_dbgout.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
...
...
@@ -2088,9 +2082,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\be\beloopana.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopystat.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedbgout.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
...
...
@@ -2271,9 +2262,6 @@
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyopt_t.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopystat.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\bedomfront.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
...
...
@@ -3741,9 +3729,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\be\beloopana.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopystat.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedbgout.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
...
...
@@ -3924,9 +3909,6 @@
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyopt_t.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopystat.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\bedomfront.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
...
...
@@ -5388,9 +5370,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\be\beloopana.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\becopystat.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\be\bedbgout.c"
>
<Filter>
ir\be
</Filter>
</ClCompile>
...
...
@@ -5571,9 +5550,6 @@
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopyopt_t.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\becopystat.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\ir\be\bedomfront.h"
>
<Filter>
ir\be
</Filter>
</ClInclude>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment