Changeset: c476ed5ed3a7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c476ed5ed3a7
Modified Files:
        monetdb5/optimizer/opt_remap.c
Branch: default
Log Message:

also remap batmal multiplex functions (fixes rapi12)


diffs (70 lines):

diff --git a/monetdb5/optimizer/opt_remap.c b/monetdb5/optimizer/opt_remap.c
--- a/monetdb5/optimizer/opt_remap.c
+++ b/monetdb5/optimizer/opt_remap.c
@@ -20,15 +20,15 @@ static int
 OPTremapDirect(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, Module 
scope){
        str mod,fcn;
        char buf[1024];
-       int i;
+       int i, retc = pci->retc;
        InstrPtr p;
 
        (void) stk;
-       mod = VALget(&getVar(mb, getArg(pci, 1))->value);
-       fcn = VALget(&getVar(mb, getArg(pci, 2))->value);
+       mod = VALget(&getVar(mb, getArg(pci, retc+0))->value);
+       fcn = VALget(&getVar(mb, getArg(pci, retc+1))->value);
 
        if(strncmp(mod,"bat",3)==0)
-               return 0;
+               mod+=3;
        OPTDEBUGremap 
                mnstr_printf(cntxt->fdout,"#Found a candidate %s.%s\n",mod,fcn);
 
@@ -99,11 +99,14 @@ OPTmultiplexInline(Client cntxt, MalBlkP
        InstrPtr q = NULL, sig;
        char buf[1024];
        int i,j,k, actions=0;
-       int refbat=0;
+       int refbat=0, retc = p->retc;
        bit *upgrade;
        Symbol s;
-       s= findSymbol(cntxt->nspace, VALget(&getVar(mb, getArg(p, 1))->value),
-                       VALget(&getVar(mb, getArg(p, 2))->value));
+
+
+       s= findSymbol(cntxt->nspace, 
+                       VALget(&getVar(mb, getArg(p, retc+0))->value),
+                       VALget(&getVar(mb, getArg(p, retc+1))->value));
 
        if( s== NULL || !isSideEffectFree(s->def) || 
                getInstrPtr(s->def,0)->retc != p->retc ) {
@@ -347,14 +350,14 @@ OPTremapImplementation(Client cntxt, Mal
 
        for (i = 0; i < limit; i++) {
                p = old[i];
-               if (isMultiplex(p) && getModuleId(p) != batmalRef /* for now 
only simple mal.multiplex */){
+               if (isMultiplex(p)){
                        /*
                         * The next step considered is to handle inlined 
functions.
                         * It means we have already skipped the most obvious 
ones,
                         * such as the calculator functions. It is particularly
                         * geared at handling the PSM code.
                         */
-                       if ( varGetProp(mb,getArg(p,0),inlineProp)!= NULL) {
+                       if (varGetProp(mb,getArg(p,0),inlineProp)!= NULL) {
                                OPTDEBUGremap{
                                        mnstr_printf(cntxt->fdout,"#Multiplex 
inline\n");
                                        
printInstruction(cntxt->fdout,mb,0,p,LIST_MAL_ALL);
@@ -364,9 +367,8 @@ OPTremapImplementation(Client cntxt, Mal
                                        doit++;
                                OPTDEBUGremap
                                        mnstr_printf(cntxt->fdout,"#doit 
%d\n",doit);
-                       } else 
-                       if(     OPTremapDirect(cntxt, mb, stk, p, scope) ||
-                               OPTremapSwitched(cntxt, mb, stk, p, scope)){
+                       } else if (OPTremapDirect(cntxt, mb, stk, p, scope) ||
+                               OPTremapSwitched(cntxt, mb, stk, p, scope)) {
                                freeInstruction(p); 
                                doit++;
                        } else {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to