Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19804/compiler/mil
Modified Files:
mil_opt.c milprint_summer.c
Log Message:
propagated changes of Wednesday Jun 06 2007 - Wednesday Jun 06 2007
from the XQuery_0-18 branch to the development trunk
Index: mil_opt.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil_opt.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- mil_opt.c 25 May 2007 10:27:39 -0000 1.28
+++ mil_opt.c 6 Jun 2007 20:19:27 -0000 1.29
@@ -381,7 +381,7 @@
/* OK, delete the statements */
do {
- o->stmts[stmt].deleted = 1;
+ o->stmts[stmt].deleted = o->delete;
o->stmts[stmt].nilassign = 0;
if (++stmt == OPT_STMTS) stmt = 0;
} while (stmt != until);
@@ -455,7 +455,7 @@
*/
static void opt_elim(opt_t* o, unsigned int stmt, int kill_nilassign) {
unsigned int assigns_to = o->stmts[stmt].assigns_to;
- if ((assigns_to < 32768) & (o->stmts[stmt].used == 0) &
o->stmts[stmt].inactive & (o->curvar+1 < OPT_VARS)) {
+ if ((assigns_to < 32768) & (o->stmts[stmt].used == 0) &
o->stmts[stmt].inactive & (o->curvar+1 < OPT_VARS)) {
char *p = o->stmts[stmt].mil;
o->stmts[stmt].assigns_to |= 32768; /* this ensures we kill the
statement only once */
@@ -472,7 +472,7 @@
if (p[0] == ':' && p[1] == '=') {
*p++ = 0; /* special case: "var x := y" =>
"var x ;" */
}
- o->stmts[stmt].deleted = 1;
+ o->stmts[stmt].deleted = o->delete;
}
/* decrement the references (if any) and try to eliminate more
*/
while(o->stmts[stmt].refs > 0) {
@@ -527,7 +527,7 @@
#endif
opt_elimvar(o, o->curvar = i, 0);
if (o->stmts[stmt].stmt_nr == o->vars[i].def_stmt_nr &&
o->stmts[stmt].used == 0) {
- o->stmts[stmt].deleted = 1;
+ o->stmts[stmt].deleted = o->delete;
}
}
}
@@ -578,7 +578,7 @@
}
} else {
/* delete this statement */
- o->stmts[stmt].deleted = 1;
+ o->stmts[stmt].deleted = o->delete;
}
}
@@ -602,7 +602,7 @@
o->stmts[stmt_nr].refs++;
}
o->stmts[o->vars[var_nr].lastset[i]].used++;
-#ifdef OPT_COND
+#ifdef OPT_CODEMOTION
opt_move_kill(o, o->vars[var_nr].lastset[i]);
#endif
}
@@ -747,7 +747,9 @@
o->condifelse[o->condlevel] =
o->else_statement;
opt_start_cond(o, OPT_COND(o));
o->else_statement = o->if_statement = 0;
- }
+ } else if (o->if_statement | o->else_statement)
{
+ o->delete = 0; /* after if-nesting
overflow we cannot guarantee correctness further on anymore */
+ }
break; /* blocks are separate statements */
} else if (p[0] == '}') {
char *q = opt_skip(p+1, 1); /* peek over
whitespace & comment */
@@ -874,6 +876,7 @@
if (o) {
memset(o, 0, sizeof(opt_t));
o->optimize = optimize;
+ o->delete = 1;
o->sec = OPT_SEC_IGNORE;
opt_setname("if", &name_if);
opt_setname("else", &name_else);
Index: milprint_summer.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint_summer.c,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -d -r1.387 -r1.388
--- milprint_summer.c 1 Jun 2007 16:31:29 -0000 1.387
+++ milprint_summer.c 6 Jun 2007 20:19:28 -0000 1.388
@@ -11482,8 +11482,9 @@
" ws_destroy(ws);\n"\
"}}\n"\
PF_STOP_PFTIJAH\
- "if (not(isnil(err))) ERROR(err);\n"\
- "else if (genType.startsWith(\"timing\")) {\n"\
+ "if (not(isnil(err))) {\n"\
+ " ERROR(err);\n"\
+ "} else if (genType.startsWith(\"timing\")) {\n"\
" time_print := usec() - time_print;\n"\
" printf(\"\\nTrans %% 10.3f msec\\nShred %% 10.3f msec\\nQuery
%% 10.3f msec\\n" LASTPHASE " %% 10.3f msec\\n\","\
" dbl(time_compile)/1000.0, dbl(time_shred)/1000.0,
dbl(time_exec - time_shred)/1000.0, time_print/1000.0);\n}"
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins