55 #if defined(SSA_DEBUG_VERBOSE)
73 #ifdef SSA_DEBUG_VERBOSE
110 #if defined(ENABLE_LOOPS)
114 log_text(
"lsra not possible with loop optimization\n");
153 #ifdef SSA_DEBUG_VERBOSE
155 printf(
"Phi before Cleanup\n");
161 #ifdef SSA_DEBUG_VERBOSE
168 #ifdef SSA_DEBUG_VERBOSE
170 printf(
"Phi after dead code elemination\n");
178 #ifdef SSA_DEBUG_VERBOSE
180 printf(
"Phi after copy propagation\n");
192 #ifdef SSA_DEBUG_CHECK
194 int i, j, pred, in_d, out_d;
208 for (; in_d >= 0; in_d--) {
210 for (j = 0; (!phi_define) && (j<ls->ssavarcount); j++) {
211 if (ls->
phi[i][j] != NULL)
212 if (ls->
phi[i][j][0] == in[in_d])
221 for(; out_d > in_d; out_d--);
222 if ((in[in_d] != out[out_d]) ||
223 (
VAR(in[in_d])->flags !=
VAR(out[out_d])->flags)) {
226 printf(
"Error: Stack Varnum Mismatch BBin %3i BBout %3i Stackdepth %3i\n", i, pred, in_d);
228 printf(
"Error: Stack Varnum Mismatch BBin %3i BBout %3i Stackdepth %3i\n", i, pred, in_d);
241 #ifdef SSA_DEBUG_VERBOSE
278 int i, l, b_index, len;
293 #if defined(SSA_DEBUG_CHECK) || defined(SSA_DEBUG_VERBOSE)
294 # if defined(SSA_DEBUG_VERBOSE)
302 if (strcmp(m->
clazz->
name.
begin(),
"spec/benchmarks/_213_javac/Parser")==0)
303 if (strcmp(m->
name.
begin(),
"parseTerm")==0)
304 # if defined(SSA_DEBUG_VERBOSE)
306 printf(
"12-------------------12\n");
308 {
int dummy=1; dummy++; }
312 #ifdef SSA_DEBUG_VERBOSE
314 printf(
"ssa_init: basicblockcount %3i localcount %3i\n",
367 for(; bptr != NULL; bptr = bptr->
next) {
368 #ifdef SSA_DEBUG_VERBOSE
370 printf(
"ssa_init: BB %3i state %3x\n",bptr->
nr, bptr->
state);
386 for (; len > 0; len--, iptr++) {
398 bte = iptr->
sx.
s23.s3.bte;
408 if (( v < jd->localcount) || (
VAR(v)->flags &
INOUT )) {
420 #ifdef SSA_DEBUG_VERBOSE
425 if ((i < jd->localcount) || (
VAR(i)->flags &
INOUT)) {
428 if (i < ls->ssavarcount) {
533 int o_map_index, i_map_index;
553 for(;(in_d > out_d); in_d--) {
554 i_map_index = in_d * 5 +
VAR(in[in_d])->type;
558 while((out_d >= 0)) {
561 o_map_index = out_d * 5 +
VAR(out[out_d])->type;
563 i_map_index = in_d * 5 +
VAR(in[in_d])->type;
577 #ifdef SSA_DEBUG_VERBOSE
586 printf(
"Dominator Tree: \n");
590 if (dd->
idom[j] == i) {
597 printf(
"Dominator Forest:\n");
600 for(j = 0; j < dd->
num_DF[
i]; j++) {
611 if ((j % 5) == 0)
printf(
" ");
621 printf(
"var Definitions:\n");
625 if ((j % 5) == 0)
printf(
" ");
632 for(j=0; j < ((((ls->
ssavarcount * 5+7)/8) +
sizeof(int) - 1)/
sizeof(int));
656 bool remove_statement;
660 #ifdef SSA_DEBUG_VERBOSE
697 remove_statement = (lt->
use != NULL) && (lt->
use->
iindex < 0);
698 for(use = lt->
use; (remove_statement && (use != NULL));
701 remove_statement = remove_statement &&
706 if (remove_statement) {
707 #ifdef SSA_DEBUG_CHECK
711 if (remove_statement)
720 if (lt->
use == NULL) {
759 #ifdef SSA_DEBUG_VERBOSE
761 printf(
"dce: BB%3i phi for var %3i=%3i removed \n",
773 remove_statement =
false;
785 remove_statement =
false;
786 #ifdef SSA_DEBUG_VERBOSE
788 printf(
"dce: PEI: BB%3i II%3i %s not removed \n",
796 remove_statement =
true;
801 a = iptr->
sx.
s23.s3.varindex;
811 a = iptr->
sx.
s23.s2.varindex;
831 #ifdef SSA_DEBUG_VERBOSE
833 printf(
"dce: BB%3i II%3i %s removed \n",
840 if (remove_statement) {
844 #ifdef SSA_DEBUG_VERBOSE
846 printf(
"dce: %s %s:at BB %3i II %3i NOP-<%s\n",
858 #ifdef SSA_DEBUG_VERBOSE
932 only_source = source;
946 #ifdef SSA_DEBUG_VERBOSE
949 "-- copy propagation phi-func: BB %3i II %3i: %3i -> %3i\n",
981 #ifdef SSA_DEBUG_VERBOSE
1012 #ifdef SSA_DEBUG_VERBOSE
1015 "-- copy propagation %3i %s: BB %3i II %3i: %3i -> %3i\n",
1059 #ifdef SSA_DEBUG_VERBOSE
1086 for(s = lt->
use; s != NULL; s = s->
next) {
1100 #ifdef SSA_DEBUG_VERBOSE
1104 "copy propagation phi: BB %3i I %3i: %3i -> %3i\n",
1114 #ifdef SSA_DEBUG_VERBOSE
1118 "copy propagation phi: BB %3i I %3i: %3i -> %3i\n",
1147 #ifdef SSA_DEBUG_VERBOSE
1150 printf(
"copy propagation loc3: BB %3i I %3i: %3i -> \
1152 new_v_index, iptr->
sx.
s23.s3.varindex);
1155 iptr->
sx.
s23.s3.varindex = new_v_index;
1163 #ifdef SSA_DEBUG_VERBOSE
1166 printf(
"copy propagation loc2: BB %3i I %3i: %3i -> \
1168 new_v_index, iptr->
sx.
s23.s2.varindex);
1171 iptr->
sx.
s23.s2.varindex = new_v_index;
1181 #ifdef SSA_DEBUG_VERBOSE
1185 "copy propagation loc1: BB %3i I %3i: %3i -> %3i\n",
1204 bte = iptr->
sx.
s23.s3.bte;
1213 argp = iptr->
sx.
s23.s2.args;
1216 #ifdef SSA_DEBUG_VERBOSE
1220 "copy propagation locN: BB %3i I %3i: %3i -> %3i\n"
1224 *argp = new_v_index;
1235 #ifdef SSA_DEBUG_VERBOSE
1240 printf(
"SSA LT Def/Use\n");
1252 if (lt->
def != NULL)
1255 printf(
"%3i,%3i Use: ",0,0);
1256 for(use = lt->
use; use != NULL; use = use->
next)
1274 default: type =
'?';
1277 if (index < jd->localcount) {
1280 printf(
"<INVALID FLAGS!>");
1286 printf(
"<INVALID FLAGS!>");
1294 printf(
"%c%c%3d", kind, type, index);
int graph_get_next(graphiterator *i)
void ssa_set_iovar(lsradata *, s4, int, s4 *)
void cfg_add_root(jitdata *jd)
int varcount_with_indices
void computeDF(graphdata *gd, dominatordata *dd, int basicblockcount, int n)
void lt_lifeness_analysis(jitdata *jd, graphdata *gd)
void lt_remove_use_site(struct lifetime *lt, int block, int iindex)
void ssa_set_interface(jitdata *, basicblock *, s4 *)
void ssa_print_phi(lsradata *, graphdata *)
void ssa_show_variable(jitdata *jd, int index, varinfo *v, int stage)
int graph_get_first_predecessor(graphdata *gd, int b_index, graphiterator *i)
struct lifetime * lifetime
bool bv_get_bit(bitvector bv, int bit)
void cfg_remove_root(jitdata *jd)
static int code_is_leafmethod(codeinfo *code)
void ssa_print_trees(jitdata *jd, graphdata *gd, dominatordata *dd)
void _ssa_print_lt(struct lifetime *lt)
#define IS_2_WORD_TYPE(a)
void lt_scanlifetimes(jitdata *jd, graphdata *gd, dominatordata *dd)
void ssa_replace_use_sites(jitdata *, graphdata *, struct lifetime *, int, worklist *)
static void ssa_rename(ssa_info *ssa)
void simple_constant_propagation()
void ssa_init(jitdata *jd)
Type
Types used internally by JITTED code.
void transform_BB(jitdata *jd, graphdata *gd)
bool wl_is_empty(worklist *w)
basicblock ** basicblocks
void graph_make_cfg(jitdata *jd, graphdata *gd)
union instruction::@12 sx
icmdtable_entry_t icmd_table[256]
#define INSTRUCTION_GET_METHODDESC(iptr, md)
void lt_move_use_sites(struct lifetime *from, struct lifetime *to)
void cfg_add_exceptional_edges(jitdata *jd)
byte_iterator begin() const
int graph_get_num_predecessor(graphdata *gd, int b_index)
void ssa_set_def(lsradata *, int, int)
worklist * wl_new(int size)
void ssa_set_local_def(lsradata *, int, int)
void ssa_generate_phi_moves(jitdata *jd, graphdata *gd)
void dead_code_elimination(jitdata *jd, graphdata *gd)
dominatordata * compute_Dominators(graphdata *gd, int basicblockcount)
void wl_add(worklist *w, int element)
void copy_propagation(jitdata *jd, graphdata *gd)
struct instruction::@12::@13 s23
bitvector bv_new(int size)
void bv_set_bit(bitvector bv, int bit)
graphdata * graph_init(int basicblockcount)
void ssa_print_lt(lsradata *ls)
static void ssa_place_phi_functions(ssa_info *ssa)