[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: default - Avoid append instructions to disappear
From:       Martin Kersten <commits+mk=cwi.nl () monetdb ! org>
Date:       2017-12-20 21:15:31
Message-ID: hg.0276d6b12a9b.1513804531.6315528441665844383 () monetdb-vm0 ! spin-off ! cwi ! nl
[Download RAW message or body]

Changeset: 0276d6b12a9b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0276d6b12a9b
Modified Files:
	monetdb5/optimizer/opt_deadcode.c
Branch: default
Log Message:

Avoid append instructions to disappear
Calling this optimizer after a multiplex expansion
could lead to removal of append() instructions.
The test showing it div_zero.Bug-3742.


diffs (14 lines):

diff --git a/monetdb5/optimizer/opt_deadcode.c b/monetdb5/optimizer/opt_deadcode.c
--- a/monetdb5/optimizer/opt_deadcode.c
+++ b/monetdb5/optimizer/opt_deadcode.c
@@ -63,7 +63,9 @@ OPTdeadcodeImplementation(Client cntxt, 
 		}
 		if ( getModuleId(p) == batRef && isUpdateInstruction(p) && !p->barrier){
 			/* bat.append and friends are intermediates that need not be retained 
-			 * unless they are used */
+			 * unless they are not used outside of an update */
+			if( varused[getArg(p,1)] > 1 )
+				varused[getArg(p,0)]++; // force keeping it
 		} else
 		if (hasSideEffects(mb, p, FALSE) || !isLinearFlow(p) || 
 				(p->retc == 1 && mb->unsafeProp) || p->barrier /* ==side-effect */){
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic