49 #ifdef LT_DEBUG_VERBOSE
64 int iindex,
struct lifetime *lt,
bool life_in,
80 return ((*iter) = lt->
use);
87 return ((*iter) = (*iter)->next);
91 return ((*iter) = lt->
def);
96 struct site *def_site;
101 && (def_site->
iindex == iindex));
102 return is_defined_at_s;
125 #if defined(LT_DEBUG_VERBOSE)
165 #ifdef LT_DEBUG_VERBOSE
176 struct site *def, *use;
177 bool all_in_same_block;
182 all_in_same_block =
true;
183 for (; (all_in_same_block && (use != NULL));
188 return all_in_same_block;
235 struct site *use_site, *u_site;
244 struct timespec time_start,time_end;
255 if (clock_gettime(CLOCK_THREAD_CPUTIME_ID,&(time_start)) != 0) {
256 fprintf(stderr,
"could not get time: %s\n",strerror(errno));
261 M =
bv_new(ls->basicblockcount);
262 use =
bv_new(ls->basicblockcount);
263 W =
wl_new(ls->basicblockcount);
265 #ifdef LT_DEBUG_VERBOSE
269 for(lt_index = 0; lt_index < ls->lifetimecount; lt_index++) {
270 lt = &(ls->lifetime[lt_index]);
273 #ifdef LT_DEBUG_VERBOSE
275 printf(
"LT: %3i:", lt_index);
295 if (use_site == NULL) {
305 iindex = use_site->
iindex;
308 (iindex <= lt->def->iindex)) {
327 for(iter1= iter; u_site != NULL;
333 (u_site->
iindex > iindex1)) {
337 (u_site->
iindex > iindex))
345 #ifdef LT_DEBUG_VERBOSE
357 phi = ls->phi[use_site->
b_index][-iindex-1];
362 for(i = 1; (pred != -1); i++,pred =
373 iindex, lt,
true, W);
384 #ifdef LT_DEBUG_VERBOSE
392 if (clock_gettime(CLOCK_THREAD_CPUTIME_ID,&(time_end)) != 0) {
393 fprintf(stderr,
"could not get time: %s\n",strerror(errno));
401 diff = (time_end.tv_nsec - time_start.tv_nsec) / 1000;
402 atime = time_start.tv_sec;
403 while (atime < time_end.tv_sec) {
407 printf(
"%8li %s.%s.%s\n", diff,
430 int iindex,
struct lifetime *lt,
bool life_in,
440 #ifdef LT_DEBUG_VERBOSE
442 printf(
"LO@ST: vi %3i bi %3i ii %3i\n",
457 if ((iindex >= 0) && (b_index != 0)) {
476 #ifdef LT_DEBUG_VERBOSE
478 printf(
"LO@ST: vi %3i bi %3i ii %3i\n",
481 printf(
"--> definition\n");
496 #ifdef LT_DEBUG_VERBOSE
498 printf(
"LI@ST: vi %3i bi %3i ii %3i\n",
507 #ifdef LT_DEBUG_VERBOSE
509 printf(
"LI@ST: vi %3i bi %3i ii %3i\n",
528 prev_iindex = iindex - 1;
533 for(; prev_iindex > -ls->
ssavarcount-1; prev_iindex--)
534 if (ls->
phi[b_index][-prev_iindex-1] != NULL)
539 iindex = prev_iindex;
550 #if defined(LT_DEBUG_VERBOSE)
581 if (from->
use == NULL)
708 #ifdef LT_DEBUG_VERBOSE
710 printf(
"_lt_scanlifetimes: BB %3i flags %3i\n", b_index, bptr->
state);
719 iindex = bptr->
icount - 1;
729 if (ls->
phi[b_index][i] != NULL) {
731 v = ls->
phi[b_index][
i][0];
736 #ifdef LT_DEBUG_VERBOSE
738 printf(
"_lt_scanlifetimes: phi_def: v: %3i\n i: %3i\n",
754 if (bptr->
iinstr != NULL) {
756 iptr = bptr->
iinstr + iindex;
760 for (;iindex >= 0; iindex--, iptr--) {
797 bte = iptr->
sx.
s23.s3.bte;
811 argp = iptr->
sx.
s23.s2.args;
833 while(!dominates && (dd->
idom[j] != -1)) {
834 dominates = (i == dd->
idom[j]);
873 for (j = 0; j < dd->
num_DF[
i]; j++) {
874 if (succ == dd->
DF[i][j]) {
905 loop_parent[lh] = -1;
907 for (j = 0; j < dd->
num_DF[lh]; j++) {
909 if (lh != dd->
DF[lh][j]) {
911 #ifdef LT_DEBUG_VERBOSE
913 if (loop_parent[lh] != -1)
914 printf(
"Warning: LoopHeader has more than one parent\n");
917 loop_parent[lh] = dd->
DF[lh][j];
926 for (lh_p = lh; lh_p != -1; lh_p = loop_parent[lh_p]) {
936 for(j = 0; j < dd->
num_DF[
i]; j++) {
940 #ifdef LT_DEBUG_VERBOSE
943 printf(
"Warning: More than one loopheader for one BB\n");
952 #ifdef LT_DEBUG_VERBOSE
954 printf(
"Num Loops: %3i\n",num_loops);
struct site * lt_get_next_site(lt_iterator *iter)
int graph_get_next(graphiterator *i)
void lt_usage(jitdata *, s4, int, int, int)
struct site * lt_get_first_use_site(struct lifetime *lt, lt_iterator *iter)
int varcount_with_indices
void lt_lifeness_analysis(jitdata *jd, graphdata *gd)
void lt_remove_use_site(struct lifetime *lt, int block, int iindex)
void lt_is_live(lsradata *ls, struct lifetime *lt, int b_index, int iindex)
void _lt_scanlifetimes(jitdata *jd, graphdata *gd, basicblock *bptr, int)
int graph_get_first_predecessor(graphdata *gd, int b_index, graphiterator *i)
struct lifetime * lifetime
bool bv_get_bit(bitvector bv, int bit)
bool lt_v_is_defined_at_s(lsradata *ls, int b_index, int iindex, struct lifetime *lt)
void graph_DFS(lsradata *ls, graphdata *gd)
void wl_reset(worklist *w, int size)
struct site * lt_get_first_def_site(struct lifetime *lt, lt_iterator *iter)
void lt_set_use_site(struct lifetime *lt, struct site *use_site)
#define IS_2_WORD_TYPE(a)
void lt_scanlifetimes(jitdata *jd, graphdata *gd, dominatordata *dd)
void lt_add_def_site(struct lifetime *lt, int block, int iindex)
bool wl_is_empty(worklist *w)
void bv_reset(bitvector bv, int size)
basicblock ** basicblocks
union instruction::@12 sx
icmdtable_entry_t icmd_table[256]
#define INSTRUCTION_GET_METHODDESC(iptr, md)
bool dominates(dominatordata *dd, int i, int j)
void lt_move_use_sites(struct lifetime *from, struct lifetime *to)
bool lt_is_simple_lt(struct lifetime *lt)
void lt_lifeoutatblock(lsradata *ls, graphdata *gd, int *M, int b_index, struct lifetime *lt, worklist *W)
int graph_get_num_predecessor(graphdata *gd, int b_index)
#define _LT_CHECK_BOUNDS(i, l, h)
worklist * wl_new(int size)
void wl_add(worklist *w, int element)
struct instruction::@12::@13 s23
void lt_lifeatstatement(lsradata *ls, graphdata *gd, int b_index, int iindex, struct lifetime *lt, bool life_in, worklist *W)
bitvector bv_new(int size)
void bv_set_bit(bitvector bv, int bit)
void lt_add_use_site(struct lifetime *lt, int block, int iindex)
void lt_get_nesting(lsradata *ls, graphdata *gd, dominatordata *dd)
int graph_get_first_successor(graphdata *gd, int b_index, graphiterator *i)
void lt_set_simple_use(lsradata *ls, struct lifetime *lt)