Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12406

Modified Files:
        opt_remap.mx 
Log Message:
during multiplexed inlineing we have to be careful about barrier blocks.
if entrance to the barrier or redo/leave is dependent on an upgraded 
type, we bail out.

inlineCst.mal is a todo action.


Index: opt_remap.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_remap.mx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- opt_remap.mx        11 Jan 2008 10:41:39 -0000      1.23
+++ opt_remap.mx        19 Jan 2008 11:06:13 -0000      1.24
@@ -218,7 +218,6 @@
                for(j=0; j<q->argc && !fnd; j++) 
                        if (upgrade[getArg(q,j)]) {
                                for(k=0; k<q->retc; k++){
-                                       //setVarType(mq,getArg(q,k),TYPE_any);
                                        
setVarType(mq,getArg(q,j),newBatType(TYPE_oid,getArgType(mq, q, j)));
                                        /* for typing */
                                        clrVarFixed(mq,getArg(q,k)); 
@@ -234,18 +233,29 @@
                if (!getModuleId(q) && q->token == ASSIGNsymbol &&
                    q->argc == 2 && isVarConstant(mq, getArg(q,1)) && 
                    upgrade[getArg(q,0)] &&
-                   !isaBatType(getArgType(mq, q, 1)) &&
-                   ATOMcmp(getArgGDKType(mq, q, 1),
-                       VALget(&getVar(mq, getArg(q,1))->value),
-                       ATOMnilptr(getArgType(mq, q, 1))) == 0) {
-                       ValRecord cst;
-                       int tpe = newBatType(TYPE_oid,getArgType(mq, q, 1));
+                   !isaBatType(getArgType(mq, q, 1)) ){
+                               /* handle nil assignment */
+                               if( ATOMcmp(getArgGDKType(mq, q, 1),
+                                       VALget(&getVar(mq, getArg(q,1))->value),
+                                       ATOMnilptr(getArgType(mq, q, 1))) == 0) 
{
+                               ValRecord cst;
+                               int tpe = newBatType(TYPE_oid,getArgType(mq, q, 
1));
 
-                       setVarType(mq,getArg(q,0),tpe);
-                       cst.vtype = TYPE_bat;
-                       cst.val.bval = bat_nil;
-                       getArg(q,1) = defConstant(mq, tpe, &cst);
-                       setVarType(mq, getArg(q,1), tpe);
+                               setVarType(mq,getArg(q,0),tpe);
+                               cst.vtype = TYPE_bat;
+                               cst.val.bval = bat_nil;
+                               getArg(q,1) = defConstant(mq, tpe, &cst);
+                               setVarType(mq, getArg(q,1), tpe);
+                       } else{
+                               /* handle constant tail setting */
+                               int tpe = newBatType(TYPE_oid,getArgType(mq, q, 
1));
+
+                               setVarType(mq,getArg(q,0),tpe);
+                               setModuleId(q,algebraRef);
+                               setFunctionId(q,projectRef);
+                               q= pushArgument(mb,q, getArg(q,1));
+                               getArg(q,1)= getArg(q,0);
+                       }
                }
        }
 
@@ -255,21 +265,30 @@
                if( q->token== ENDsymbol)
                        break;
                for(j=0; j<q->argc; j++)
-                       if (upgrade[getArg(q,j)] && getModuleId(q)){
-                               snprintf(buf,1024,"bat%s",getModuleId(q));
-                               setModuleId(q,putName(buf,strlen(buf)));
-
-                               /* now see if we can resolve the instruction */
-                               typeChecker(MCgetClient()->nspace,mq,q,TRUE);
-                               if( q->typechk== TYPE_UNKNOWN)
+                       if ( upgrade[getArg(q,j)]){
+                               if ( blockStart(q) || 
+                                        q->barrier== REDOsymbol || 
q->barrier==LEAVEsymbol )
                                        goto terminateMX;
-                               break;
-                       }
+                               if (getModuleId(q)){
+                                       
snprintf(buf,1024,"bat%s",getModuleId(q));
+                                       setModuleId(q,putName(buf,strlen(buf)));
+
+                                       /* now see if we can resolve the 
instruction */
+                                       
typeChecker(MCgetClient()->nspace,mq,q,TRUE);
+                                       if( q->typechk== TYPE_UNKNOWN)
+                                               goto terminateMX;
+                                       break;
+                               }
+               }
        }
 
 
        if(mq->errors){
 terminateMX:
+#ifdef DEBUG_OPT_REMAP
+               stream_printf(GDKout,"Abort remap\n");
+               printInstruction(GDKout,mb,q,LIST_MAL_ALL);
+#endif
                freeMalBlk(mq);
                GDKfree(upgrade);
                return 0;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to