Changeset: e7f6ec69f5d5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e7f6ec69f5d5
Removed Files:
        monetdb5/optimizer/Tests/SRexample.mal
        monetdb5/optimizer/Tests/SRexample.stable.err
        monetdb5/optimizer/Tests/SRexample.stable.out
        monetdb5/optimizer/Tests/tst4820.mal
        monetdb5/optimizer/Tests/tst4820.stable.err
        monetdb5/optimizer/Tests/tst4820.stable.out
        monetdb5/optimizer/opt_strengthReduction.c
        monetdb5/optimizer/opt_strengthReduction.h
Modified Files:
        monetdb5/optimizer/Makefile.ag
        monetdb5/optimizer/Tests/All
        monetdb5/optimizer/opt_wrapper.c
        monetdb5/optimizer/optimizer.mal
Branch: default
Log Message:

Drop strengthreduction optimizer
This was an non-used experimental optimizer


diffs (truncated from 535 to 300 lines):

diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -65,7 +65,6 @@ lib_optimizer = {
                opt_remoteQueries.c opt_remoteQueries.h \
                opt_reorder.c opt_reorder.h \
                opt_statistics.c opt_statistics.h \
-               opt_strengthReduction.c opt_strengthReduction.h \
                opt_support.c opt_support.h \
                opt_pushselect.c opt_pushselect.h \
                opt_wrapper.c
diff --git a/monetdb5/optimizer/Tests/All b/monetdb5/optimizer/Tests/All
--- a/monetdb5/optimizer/Tests/All
+++ b/monetdb5/optimizer/Tests/All
@@ -16,7 +16,6 @@ tst4602
 tst4630
 tst4700
 tst4701
-tst4820
 
 #qep00 deprecated optimizer
 #qep01 ,,
@@ -79,7 +78,6 @@ GCexample01
 CXexample
 JPexample
 Mexample
-SRexample
 
 dataflow
 dataflow3
diff --git a/monetdb5/optimizer/Tests/SRexample.mal 
b/monetdb5/optimizer/Tests/SRexample.mal
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/SRexample.mal
+++ /dev/null
@@ -1,22 +0,0 @@
-# simple strength reduction
-       j:= "hello world";
-       k:= nil:str;
-barrier go:=true;
-       i:=23;
-       j:= "not moved";
-       k:= j;
-       io.print(i);
-       redo go:= false;
-exit go;
-       z:= j;
-# This shows it should not work for blocks in general
-       r:= "hello world";
-barrier go:=true;
-       s:=23;
-       r:= "not moved";
-       k:= r;
-       io.print(s);
-exit go;
-       z:= r;
-optimizer.strengthReduction();
-mdb.List();
diff --git a/monetdb5/optimizer/Tests/SRexample.stable.err 
b/monetdb5/optimizer/Tests/SRexample.stable.err
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/SRexample.stable.err
+++ /dev/null
@@ -1,12 +0,0 @@
-stderr of test 'SRexample` in directory 'monetdb5/optimizer` itself:
-
-
-# 11:06:44 >  
-# 11:06:44 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/log" --set 
mapi_port=30442 --set sql_port=45189 --set xquery_port=58220 --set 
monet_prompt= --trace --dbname=mTests_src_optimizer  SRexample.mal </dev/null
-# 11:06:44 >  
-
-
-# 11:06:45 >  
-# 11:06:45 >  Done.
-# 11:06:45 >  
-
diff --git a/monetdb5/optimizer/Tests/SRexample.stable.out 
b/monetdb5/optimizer/Tests/SRexample.stable.out
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/SRexample.stable.out
+++ /dev/null
@@ -1,67 +0,0 @@
-stdout of test 'SRexample` in directory 'monetdb5/optimizer` itself:
-
-
-# 23:53:04 >  
-# 23:53:04 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/log" --set 
mapi_port=39352 --set sql_port=45171 --set xquery_port=52900 --set 
monet_prompt= --trace --dbname=mTests_src_optimizer  SRexample.mal </dev/null
-# 23:53:04 >  
-
-# MonetDB server v5.9.0, based on kernel v1.27.0
-# Serving database 'mTests_src_optimizer', using 4 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008- MonetDB B.V., all rights reserved
-# Visit http://monetdb.cwi.nl/ for further information
-# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:32348/
-function user.main():void;
-    i := 23;
-# simple strength reduction 
-    j := "hello world";
-    k := nil:str;
-barrier go := true;
-    j := "not moved";
-    k := j;
-    io.print(i);
-    redo go := false;
-exit go;
-    z := j;
-# This shows it should not work for blocks in general 
-    r := "hello world";
-barrier go := true;
-    s := 23;
-    r := "not moved";
-    k := r;
-    io.print(s);
-exit go;
-    z := r;
-    mdb.List();
-end user.main;
-[ 23 ]
-[ 23 ]
-function user.main():void;              #  0 main:void := user.main() {G}
-    i := 23;                            #  1 i:int := _9:int 
-# simple strength reduction 
-    j := "hello world";                 #  3 j:str := _3:str {G}
-    k := nil:str;                       #  4 k:str := _5:str {G}
-barrier go := true;                     #  5 go:bit := _7:bit {J10}
-    j := "not moved";                   #  6 j:str := _10:str {G}
-    k := j;                             #  7 k:str := j:str {G}
-    io.print(i);                        #  8 _11:void := IOprint_val(i:int) 
-    redo go := false;                   #  9 go:bit := _12:bit {J6}
-exit go;                                # 10 go:bit 
-    z := j;                             # 11 z:str := j:str {G}
-# This shows it should not work for blocks in general 
-    r := "hello world";                 # 13 r:str := _3:str {G}
-barrier go := true;                     # 14 go:bit := _7:bit {J19}
-    s := 23;                            # 15 s:int := _9:int 
-    r := "not moved";                   # 16 r:str := _10:str {G}
-    k := r;                             # 17 k:str := r:str {G}
-    io.print(s);                        # 18 _17:void := IOprint_val(s:int) 
-exit go;                                # 19 go:bit 
-    z := r;                             # 20 z:str := r:str {G}
-    mdb.List();                         # 21 _19:void := MDBlistDetail() 
-end user.main;                          # 22  
-
-# 23:53:04 >  
-# 23:53:04 >  Done.
-# 23:53:04 >  
-
diff --git a/monetdb5/optimizer/Tests/tst4820.mal 
b/monetdb5/optimizer/Tests/tst4820.mal
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/tst4820.mal
+++ /dev/null
@@ -1,21 +0,0 @@
-#bug from Roberto to check carefull strength reduction
-function f():void;  
-  i:=0;             
-  barrier go:=true;    
-    # remove from disk
-    a:bat[:oid,:dbl] := bbp.bind("P_bat");
-    bat.setPersistent(a,false);
-    
-    # alter the values
-    a := batcalc.+(a,1.0LL);
-    
-    # store it to disk with the same name
-    bat.setName(a, "P_bat");
-    bat.setPersistent(a,true);
-    redo go := calc.<(i,2);       
-  exit go;                        
-end f;                            
-
-
-optimizer.strengthReduction("user", "f");
-mdb.List("user", "f");
diff --git a/monetdb5/optimizer/Tests/tst4820.stable.err 
b/monetdb5/optimizer/Tests/tst4820.stable.err
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/tst4820.stable.err
+++ /dev/null
@@ -1,12 +0,0 @@
-stderr of test 'tst4820` in directory 'monetdb5/optimizer` itself:
-
-
-# 23:29:21 >  
-# 23:29:21 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/log" --set 
mapi_port=36979 --set sql_port=46143 --set xquery_port=58679 --set 
monet_prompt= --trace --dbname=mTests_src_optimizer  tst4820.mal < /dev/null
-# 23:29:21 >  
-
-
-# 23:29:21 >  
-# 23:29:21 >  Done.
-# 23:29:21 >  
-
diff --git a/monetdb5/optimizer/Tests/tst4820.stable.out 
b/monetdb5/optimizer/Tests/tst4820.stable.out
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/tst4820.stable.out
+++ /dev/null
@@ -1,51 +0,0 @@
-stdout of test 'tst4820` in directory 'monetdb5/optimizer` itself:
-
-
-# 23:29:21 >  
-# 23:29:21 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/log" --set 
mapi_port=36979 --set sql_port=46143 --set xquery_port=58679 --set 
monet_prompt= --trace --dbname=mTests_src_optimizer  tst4820.mal < /dev/null
-# 23:29:21 >  
-
-# MonetDB server v5.9.0, based on kernel v1.27.0
-# Serving database 'mTests_src_optimizer', using 4 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008- MonetDB B.V., all rights reserved
-# Visit http://monetdb.cwi.nl/ for further information
-# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:32348/
-function user.f():void;
-    i := 0;
-barrier go := true;
-# remove from disk 
-    a:bat[:oid,:dbl]  := bbp.bind("P_bat");
-    bat.setPersistent(a,false);
-# alter the values 
-    a:bat[:oid,:dbl]  := batcalc.+(a,1:dbl);
-# store it to disk with the same name 
-    bat.setName(a,"P_bat");
-    bat.setPersistent(a,true);
-    redo go := calc.<(i,2);
-exit go;
-end user.f;
-function user.main():void;
-#bug from Roberto to check carefull strength reduction 
-    mdb.List("user","f");
-end user.main;
-function user.f():void;                 #  0 f:void := user.f() {G}
-# remove from disk 
-# alter the values 
-    i := 0;                             #  3 i:int := _2:int 
-barrier go := true;                     #  4 go:bit := _4:bit {J12}
-    a:bat[:oid,:dbl]  := bbp.bind("P_bat");#  5 a:bat[:oid,:dbl] := 
CMDbbpbind(_7:str) {G}
-    bat.setPersistent(a,false);         #  6 _8:void := 
BKCpersists(a:bat[:oid,:dbl], _9:bit) {G}
-    a:bat[:oid,:dbl]  := batcalc.+(a,1:dbl);#  7 a:bat[:oid,:dbl] := 
CMDbatADDsignal(a:bat[:oid,:dbl], _11:dbl) {G}
-# store it to disk with the same name 
-    bat.setName(a,"P_bat");             #  9 _13:void := 
BKCsetName(a:bat[:oid,:dbl], _7:str) {G}
-    bat.setPersistent(a,true);          # 10 _14:void := 
BKCpersists(a:bat[:oid,:dbl], _4:bit) {G}
-    redo go := calc.<(i,2);             # 11 go:bit := CMDvarLT(i:int, 
_15:int) {J3}
-exit go;                                # 12 go:bit 
-end user.f;                             # 13  
-
-# 23:29:21 >  
-# 23:29:21 >  Done.
-# 23:29:21 >  
-
diff --git a/monetdb5/optimizer/opt_strengthReduction.c 
b/monetdb5/optimizer/opt_strengthReduction.c
deleted file mode 100644
--- a/monetdb5/optimizer/opt_strengthReduction.c
+++ /dev/null
@@ -1,214 +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-2015 MonetDB B.V.
- * All Rights Reserved.
- */
-
-#include "monetdb_config.h"
-#include "opt_strengthReduction.h"
-#include "mal_interpreter.h"   /* for showErrors() */
-
-/*
- * Strength reduction implementation
- * Strength reduction of the code is defensive.
- * This first shot assumes a single loop, so we do not have to
- * maintain a complex administration. We simply split the code
- * into two sections. Those that should do Before and  Within the loop.
- *
- * A critical decision is to make sure that none of the arguments
- * are overwritten in a given context.
- */
-static int
-SRoverwritten(InstrPtr p, int varid)
-{
-       int i;
-
-       for (i =0; i < p->retc;  i++)
-               if (getArg(p, i) == varid)
-                       return 1;
-       return 0;
-}
-static int
-isNewSource(InstrPtr p) {
-       str mp= getModuleId(p);
-       if( mp == sqlRef && getFunctionId(p) == bindRef) return 1;
-       if( mp == calcRef) return 1;
-       if( mp == batcalcRef) return 1;
-       if( mp == strRef) return 1;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to