Changeset: e2e416296094 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2e416296094 Modified Files: monetdb5/optimizer/opt_datacell.mx Branch: Aug2011 Log Message:
remove left behind file diffs (166 lines): diff --git a/monetdb5/optimizer/opt_datacell.mx b/monetdb5/optimizer/opt_datacell.mx deleted file mode 100644 --- a/monetdb5/optimizer/opt_datacell.mx +++ /dev/null @@ -1,161 +0,0 @@ -@/ -The contents of this file are subject to the MonetDB Public License -Version 1.1 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is the MonetDB Database System. - -The Initial Developer of the Original Code is CWI. -Portions created by CWI are Copyright (C) 1997-July 2008 CWI. -Copyright August 2008-2011 MonetDB B.V. -All Rights Reserved. -@ - -@f opt_datacell -@a M. Kersten -@- Datacell optimizer -Assume simple queries . Clear out all non-datacell schema related sql statements, except -for the bare minimum. -@{ -@mal -pattern optimizer.datacell():str -address OPTdatacell; -pattern optimizer.datacell(mod:str, fcn:str):str -address OPTdatacell -comment "Datacell expression optimizer"; - -@h -#ifndef _OPT_DATACELL_ -#define _OPT_DATACELL_ -#include "opt_prelude.h" -#include "opt_support.h" -#include "opt_pipes.h" - -#define OPTDEBUGdatacell if ( optDebug & (1 <<DEBUG_OPT_DATACELL) ) -opt_export str OPTdatacell(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); -opt_export int OPTdatacellImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); - -#endif -@- -We keep a flow dependency table to detect. -@c -#include "monetdb_config.h" -#include "opt_datacell.h" -#include "opt_deadcode.h" -#include "mal_interpreter.h" /* for showErrors() */ -#include "mal_builder.h" -#include "opt_statistics.h" - -int -OPTdatacellImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - int actions = 0; - int i, j,limit, vlimit, slimit; - InstrPtr p, *old; - - (void) pci; - - OPTDEBUGdatacell { - mnstr_printf(cntxt->fdout, "#Datacell optimizer started\n"); - printFunction(cntxt->fdout, mb, stk, LIST_MAL_STMT); - } else (void) stk; - - old= mb->stmt; - limit = mb->stop; - slimit = mb->ssize; - vlimit = mb->vtop; - if ( newMalBlkStmt(mb, slimit) < 0) - return 0; - - for (i = 0; i < limit; i++) { - p = old[i]; - if ( getModuleId(p) == sqlRef ){ - if( getFunctionId(p ) == bindRef && getVarConstant(mb, getArg(p, p->argc-1)).val.ival == 0) { - /* only the primary BAT is used */ - pushInstruction(mb, p); - continue; - } - /* zap all expression arguments */ - clrFunction(p); - p->argc= p->retc; - for ( j=0; j< p->retc; j++ ) - if ( isaBatType(getArgType(mb,p,j) ) ) - p = pushEmptyBAT(mb, p, getArgType(mb,p,j)); - else - p = pushNil(mb, p, getArgType(mb,p,j)); - } - pushInstruction(mb, p); - } - - for (; i < slimit; i++) - if (old[i]) - freeInstruction(old[i]); - - return actions; -} - -/* #define _DEBUG_OPTIMIZER_*/ - -/* The remainder is the optimizer harnass */ - -str OPTdatacell(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p){ - str modnme; - str fcnnme; - str msg= MAL_SUCCEED; - Symbol s= NULL; - lng t,clk= GDKusec(); - int actions = 0; - - optimizerInit(); - if( p ) - removeInstruction(mb, p); - OPTDEBUGdatacell mnstr_printf(cntxt->fdout,"=APPLY OPTIMIZER datacell\n"); - if( p && p->argc > 1 ){ - if( getArgType(mb,p,1) != TYPE_str || - getArgType(mb,p,2) != TYPE_str || - !isVarConstant(mb,getArg(p,1)) || - !isVarConstant(mb,getArg(p,2)) - ) { - throw(MAL, "optimizer.datacell", ILLARG_CONSTANTS); - } - if( stk != 0){ - modnme= *(str*)getArgReference(stk,p,1); - fcnnme= *(str*)getArgReference(stk,p,2); - } else { - modnme= getArgDefault(mb,p,1); - fcnnme= getArgDefault(mb,p,2); - } - s= findSymbol(cntxt->nspace, putName(modnme,strlen(modnme)),putName(fcnnme,strlen(fcnnme))); - - if( s == NULL) { - char buf[1024]; - snprintf(buf,1024, "%s.%s",modnme,fcnnme); - throw(MAL, "optimizer.datacell", RUNTIME_OBJECT_UNDEFINED ":%s", buf); - } - mb = s->def; - stk= 0; - } - if( mb->errors ){ - /* when we have errors, we still want to see them */ - addtoMalBlkHistory(mb,"datacell"); - return MAL_SUCCEED; - } - actions= OPTdatacellImplementation(cntxt, mb,stk,p); - msg= optimizerCheck(cntxt, mb, "optimizer.datacell", actions, t=(GDKusec() - clk),OPT_CHECK_ALL); - mnstr_printf(cntxt->fdout,"=FINISHED datacell %d\n",actions); - printFunction(cntxt->fdout,mb,0,LIST_MAL_STMT | LIST_MAPI); - OPTDEBUGdatacell { - } - DEBUGoptimizers - mnstr_printf(cntxt->fdout,"#opt_reduce: %d ms\n",t); - QOTupdateStatistics("datacell",actions,t); - addtoMalBlkHistory(mb,"datacell"); - return msg; -} -@} _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
