Changeset: 845cb6482a74 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=845cb6482a74
Removed Files:
monetdb5/optimizer/opt_accessmode.mx
Modified Files:
monetdb5/optimizer/Makefile.ag
Branch: default
Log Message:
Drop unused old optimizer.
This was one of the first optimizers. Not needed anymore.
diffs (151 lines):
diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -29,7 +29,6 @@ lib_optimizer = {
NOINST
SOURCES = \
optimizer.mx \
- opt_accessmode.mx \
opt_accumulators.mx \
opt_aliases.mx \
opt_cluster.mx \
@@ -91,7 +90,7 @@ headers_mal = {
opt_remoteQueries.mx opt_joinselect.mx \
opt_reorder.mx opt_prejoin.mx opt_compression.mx \
opt_evaluate.mx opt_inline.mx opt_pushranges.mx opt_groups.mx \
- opt_accessmode.mx opt_joinpath.mx opt_heuristics.mx
opt_remap.mx \
+ opt_joinpath.mx opt_heuristics.mx opt_remap.mx \
opt_statistics.mal opt_trace.mx opt_recycler.mx
opt_dataflow.mx \
opt_cluster.mx opt_dictionary.mx opt_mapreduce.mx opt_origin.mx
\
opt_mitosis.mx opt_octopus.mx opt_centipede.mx opt_history.mx
diff --git a/monetdb5/optimizer/opt_accessmode.mx
b/monetdb5/optimizer/opt_accessmode.mx
deleted file mode 100644
--- a/monetdb5/optimizer/opt_accessmode.mx
+++ /dev/null
@@ -1,126 +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://www.monetdb.org/Legal/MonetDBLicense
-
-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-2012 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f opt_accessmode
-
-@c
-/*
- * @a M. Kersten
- * @-
- * @- Access mode optimization
- * The routine @sc{optimizer.accessmode()} reduces the number of read/write
- * mode changes of
- * variables to a minimum. Especially setting a BAT to write mode is expensive,
- * because it often implies creation of a private copy first.
- *
- * A full implementation is delayed until really needed.
- */
-@mal
-pattern optimizer.accessmode():str
-address OPTaccessmode;
-pattern optimizer.accessmode(mod:str, fcn:str):str
-address OPTaccessmode
-comment "Reduce the number of mode changes.";
-
-@h
-#ifndef _MAL_MODES_
-#define _MAL_MODES_
-#include "opt_prelude.h"
-#include "opt_support.h"
-
-@:exportOptimizer(accessmode)@
-
-#define OPTDEBUGaccessmode if ( optDebug & (1 <<DEBUG_OPT_ACCESSMODE) )
-
-#endif
-@c
-/*
- * @-
- * The implementation strategy is currently quite simple.
- * We make a scan to identify all setWriteModes and see if
- * they are later indeed to target of a function with side
- * effects.
- * We should also remember the BATs that are already been set
- * writable, to avoid subsequent calls.[todo]
- * In a second pass we can then remove/keep them upon need.
- */
-#include "monetdb_config.h"
-#include "opt_accessmode.h"
-#include "mal_interpreter.h"
-
-static int
-OPTaccessmodeImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr p)
-{
- int i, j, k;
- int actions = 0;
- InstrPtr *candidate;
- int *writeable;
- int top=0;
- (void) stk;
-
- candidate= (InstrPtr*) GDKmalloc(sizeof(InstrPtr) * mb->stop);
- if ( candidate == NULL)
- return 0;
- writeable= (int*) GDKzalloc(sizeof(int) * mb->vtop);
- if ( writeable == NULL){
- GDKfree(candidate);
- return 0;
- }
-
- for(i=0; i<mb->stop; i++){
- p= getInstrPtr(mb,i);
- if( getFunctionId(p)== setWriteModeRef && getModuleId(p)==
batRef ){
- if( writeable[getArg(p,1)] ){
- writeable[getArg(p,0)]= writeable[getArg(p,1)];
- p->token= ASSIGNsymbol;
- setModuleId(p,NULL);
- setFunctionId(p,NULL);
- p->argc=2;
- } else{
- candidate[top++] = p;
- writeable[getArg(p,0)]= getArg(p,0);
- }
- } else
- if( isUpdateInstruction(p) ){
- for(j=k=0; j<top;j++)
- if( getArg(p,1) != getArg(candidate[j],0) )
- candidate[k++]= candidate[j];
- top= k;
- }
- }
- /* now remove all candidates */
- for( j=0; j<top; j++){
- p= candidate[j];
- /* turn it into an alias */
- setModuleId(p,NULL);
- setFunctionId(p,NULL);
- p->token= ASSIGNsymbol;
- p->argc= 2;
- p->fcn= NULL;
- actions++;
- }
- (void) cntxt;
- GDKfree(candidate);
- GDKfree(writeable);
- return actions;
-}
-@include optimizerWrapper.mx
-@c
-#include "opt_statistics.h"
-@:wrapOptimizer(accessmode,OPT_CHECK_ALL)@
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list