Changeset: d3d21b37c9df for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d3d21b37c9df
Removed Files:
        monetdb5/optimizer/opt_jit.c
        monetdb5/optimizer/opt_jit.h
Modified Files:
        clients/Tests/MAL-signatures-hge.test
        clients/Tests/MAL-signatures.test
        monetdb5/optimizer/CMakeLists.txt
        monetdb5/optimizer/opt_fastpath.c
        monetdb5/optimizer/opt_pipes.c
        monetdb5/optimizer/opt_wrapper.c
        monetdb5/optimizer/optimizer.c
Branch: default
Log Message:

Removed unused JIT optimizer.


diffs (253 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -48274,16 +48274,6 @@ pattern optimizer.inline(X_0:str, X_1:st
 OPTwrapper;
 Expand inline functions
 optimizer
-jit
-pattern optimizer.jit():str 
-OPTwrapper;
-(empty)
-optimizer
-jit
-pattern optimizer.jit(X_0:str, X_1:str):str 
-OPTwrapper;
-Propagate candidate lists in just-in-time optimization
-optimizer
 json
 pattern optimizer.json():str 
 OPTwrapper;
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -36704,16 +36704,6 @@ pattern optimizer.inline(X_0:str, X_1:st
 OPTwrapper;
 Expand inline functions
 optimizer
-jit
-pattern optimizer.jit():str 
-OPTwrapper;
-(empty)
-optimizer
-jit
-pattern optimizer.jit(X_0:str, X_1:str):str 
-OPTwrapper;
-Propagate candidate lists in just-in-time optimization
-optimizer
 json
 pattern optimizer.json():str 
 OPTwrapper;
diff --git a/monetdb5/optimizer/CMakeLists.txt 
b/monetdb5/optimizer/CMakeLists.txt
--- a/monetdb5/optimizer/CMakeLists.txt
+++ b/monetdb5/optimizer/CMakeLists.txt
@@ -29,7 +29,6 @@ target_sources(optimizer
   opt_generator.c opt_generator.h
   opt_querylog.c opt_querylog.h
   opt_inline.c opt_inline.h
-  opt_jit.c opt_jit.h
   opt_projectionpath.c opt_projectionpath.h
   opt_macro.c opt_macro.h
   opt_matpack.c opt_matpack.h
diff --git a/monetdb5/optimizer/opt_fastpath.c 
b/monetdb5/optimizer/opt_fastpath.c
--- a/monetdb5/optimizer/opt_fastpath.c
+++ b/monetdb5/optimizer/opt_fastpath.c
@@ -25,7 +25,6 @@
 #include "opt_garbageCollector.h"
 #include "opt_generator.h"
 #include "opt_inline.h"
-#include "opt_jit.h"
 #include "opt_projectionpath.h"
 #include "opt_matpack.h"
 #include "opt_json.h"
@@ -134,7 +133,6 @@ OPTdefaultfastImplementation(Client cntx
        optcall(profilerStatus, OPTcandidatesImplementation);
        optcall(true, OPTdeadcodeImplementation);
        optcall(true, OPTpostfixImplementation);
-       // optcall(true, OPTjitImplementation);
        optcall(true, OPTgarbageCollectorImplementation);
 
        /* Defense line against incorrect plans  handled by optimizer steps */
diff --git a/monetdb5/optimizer/opt_jit.c b/monetdb5/optimizer/opt_jit.c
deleted file mode 100644
--- a/monetdb5/optimizer/opt_jit.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
- */
-
-/* author M.Kersten
- * This optimizer can be used for JIT optimization and moves
- * candidate lists into MAL operations where possible.
- * It should be ran after the candidates optimizer.
- * Specific snippets to be replaced
- *      C_1:bat[:oid] := sql.tid(X_0,"sys","t");
- *      X_4:bat[:int] := sql.bind(X_0,"sys","t","i",0);
- *      X_13 := algebra.projection(C_1,X_4);
- * projection can be avoided
- *
- * A candidate list can be pushed into the calculations
- */
-#include "monetdb_config.h"
-#include "mal_builder.h"
-#include "opt_jit.h"
-
-str
-OPTjitImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
-       int i, actions = 0;
-       int limit = mb->stop, slimit = mb->ssize;
-       InstrPtr p, q, *old = mb->stmt;
-       str msg = MAL_SUCCEED;
-
-       (void) stk;
-       (void) cntxt;
-
-       setVariableScope(mb);
-       if ( newMalBlkStmt(mb, mb->ssize) < 0)
-               throw(MAL,"optimizer.jit", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-
-       /* peephole optimization */
-       for (i = 0; i < limit; i++) {
-               p = old[i];
-
-               if (p->token == ENDsymbol){
-                       for(; i<limit; i++)
-                               if (old[i])
-                                       pushInstruction(mb,old[i]);
-                       break;
-               }
-               /* case 1
-                * X_527 := algebra.projection(C_353, X_329);
-                * X_535 := batcalc.-(100:lng, X_527);
-                */
-               if( getModuleId(p) == batcalcRef && *getFunctionId(p) == '-' && 
p->argc == 3 && isVarConstant(mb, getArg(p,1)) ){
-                       q= getInstrPtr(mb, getVar(mb,getArg(p,2))->updated);
-                       if ( q == 0)
-                               q= getInstrPtr(mb, 
getVar(mb,getArg(p,2))->declared);
-                       if( q && getArg(q,0) == getArg(p,2) && getModuleId(q) 
== algebraRef && getFunctionId(q) == projectionRef ){
-                               getArg(p,2)=  getArg(q,2);
-                               p= pushArgument(mb, p, getArg(q,1));
-                               actions++;
-                       }
-               }
-               pushInstruction(mb,p);
-       }
-       for(; i< slimit; i++)
-               if( old[i])
-                       pushInstruction(mb, old[i]);
-
-       GDKfree(old);
-       /* Defense line against incorrect plans */
-       msg = chkTypes(cntxt->usermodule, mb, FALSE);
-       if (!msg)
-               msg = chkFlow(mb);
-       if (!msg)
-               msg = chkDeclarations(mb);
-       /* keep actions taken as a fake argument*/
-       (void) pushInt(mb, pci, actions);
-       return msg;
-}
diff --git a/monetdb5/optimizer/opt_jit.h b/monetdb5/optimizer/opt_jit.h
deleted file mode 100644
--- a/monetdb5/optimizer/opt_jit.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
- */
-
-#ifndef _MAL_JIT_
-#define _MAL_JIT_
-#include "opt_prelude.h"
-#include "opt_support.h"
-
-extern str OPTjitImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
-
-#endif
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -114,7 +114,6 @@ static struct PIPELINES {
         "optimizer.candidates();"
         "optimizer.deadcode();"
         "optimizer.postfix();"
-//      "optimizer.jit();" awaiting the new batcalc api
         "optimizer.garbageCollector();"
         "optimizer.profiler();",
         "stable", NULL, 1},
@@ -147,7 +146,6 @@ static struct PIPELINES {
         "optimizer.candidates();"
         "optimizer.deadcode();"
         "optimizer.postfix();"
-//      "optimizer.jit();" awaiting the new batcalc api
         "optimizer.garbageCollector();"
         "optimizer.profiler();",
         "stable", NULL, 1},
@@ -188,7 +186,6 @@ static struct PIPELINES {
         "optimizer.candidates();"
         "optimizer.deadcode();"
         "optimizer.postfix();"
-//      "optimizer.jit();" awaiting the new batcalc api
         "optimizer.garbageCollector();"
         "optimizer.profiler();",
         "stable", NULL, 1},
@@ -229,7 +226,6 @@ static struct PIPELINES {
         "optimizer.candidates();"
         "optimizer.deadcode();"
         "optimizer.postfix();"
-//      "optimizer.jit();" awaiting the new batcalc api
         "optimizer.garbageCollector();"
         "optimizer.profiler();",
         "stable", NULL, 1},
@@ -270,7 +266,6 @@ static struct PIPELINES {
         "optimizer.candidates();"
         "optimizer.deadcode();"
         "optimizer.postfix();"
-//      "optimizer.jit();" awaiting the new batcalc api
         "optimizer.garbageCollector();"
         "optimizer.profiler();",
         "stable", NULL, 1},
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -35,7 +35,6 @@
 #include "opt_garbageCollector.h"
 #include "opt_generator.h"
 #include "opt_inline.h"
-#include "opt_jit.h"
 #include "opt_projectionpath.h"
 #include "opt_matpack.h"
 #include "opt_json.h"
@@ -80,7 +79,6 @@ static struct {
        {"garbageCollector", &OPTgarbageCollectorImplementation,0,0},
        {"generator", &OPTgeneratorImplementation,0,0},
        {"inline", &OPTinlineImplementation,0,0},
-       {"jit", &OPTjitImplementation,0,0},
        {"json", &OPTjsonImplementation,0,0},
        {"matpack", &OPTmatpackImplementation,0,0},
        {"mergetable", &OPTmergetableImplementation,0,0},
diff --git a/monetdb5/optimizer/optimizer.c b/monetdb5/optimizer/optimizer.c
--- a/monetdb5/optimizer/optimizer.c
+++ b/monetdb5/optimizer/optimizer.c
@@ -97,7 +97,6 @@ static mel_func optimizer_init_funcs[] =
  optwrapper_pattern("dataflow", "Dataflow bracket code injection"),
  optwrapper_pattern("deadcode", "Dead code optimizer"),
  optwrapper_pattern("emptybind", "Evaluate empty set expressions"),
- optwrapper_pattern("jit", "Propagate candidate lists in just-in-time 
optimization"),
  optwrapper_pattern("evaluate", "Evaluate constant expressions once"),
  optwrapper_pattern("garbageCollector", "Garbage collector optimizer"),
  optwrapper_pattern("generator", "Sequence generator optimizer"),
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to