[m-rev.] for review: fix delay death and parallel conjunctions

Peter Wang wangp at students.cs.mu.OZ.AU
Mon Jul 3 18:52:25 AEST 2006


On 2006-07-03, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> 
> On Fri, 30 Jun 2006, Peter Wang wrote:
> 
> > Estimated hours taken: 6
> > Branches: main
> >
> > compiler/liveness.m:
> > 	Fix the deadness pass's handling of parallel conjunctions.
> 
> The log message should mention what was wrong with it.

I'm not 100% sure of the reasoning.

> >
> > 	Also make detect_deadness_in_par_conj look more similar to
> > 	detect_deadness_in_disj and detect_deadness_in_cases.
> 
> Is this just a cosmetic change?

Yes.

 
 compiler/liveness.m:
 	Fix the deadness pass's handling of parallel conjunctions.
+	The set of dead variables at the end of a parallel conjunction
+	should not necessarily include all the variables dead at the 
+	end of the goal that the parallel conjunction is in.
 	This was causing problems with later passes (delay death and resume
 	point detection) because variables were appearing in the pre-death
 	and post-death sets that they shouldn't have.


diff -u tests/par_conj/Mercury.options tests/par_conj/Mercury.options
--- tests/par_conj/Mercury.options	30 Jun 2006 04:38:04 -0000
+++ tests/par_conj/Mercury.options	3 Jul 2006 06:50:36 -0000
@@ -1,2 +1,5 @@
+# These test cases are compiled with --trace deep because they
+# are regression tests for a bug that only shows up with deep
+# tracing.
 MCFLAGS-par_ddeath = --trace deep
 MCFLAGS-par_ddeath_2 = --trace deep
diff -u tests/par_conj/Mmakefile tests/par_conj/Mmakefile
--- tests/par_conj/Mmakefile	30 Jun 2006 08:37:05 -0000
+++ tests/par_conj/Mmakefile	3 Jul 2006 06:48:08 -0000
@@ -36,15 +36,26 @@
 	dep_par_20 \
 	dep_par_21 \
 	dep_par_22 \
-	dep_par_23 \
-	par_ddeath
+	dep_par_23 
 
 INDEP_PAR_CONJ_PROGS = \
 	indep_par_append \
 	indep_par_nested \
-	par_ddeath \
 	threads_hang
 
+# These tests require debugging, which hasn't been implemented for
+# the MLDS backend.
+#
+LLDS_PROGS = \
+	par_ddeath \
+	par_ddeath_2
+
+ifeq "$(filter hl% java% il%,$(GRADE))" ""
+	PROGS0 = $(LLDS_PROGS)
+else
+	PROGS0 =
+endif
+
 ifneq "$(findstring decldebug,$(GRADE))" ""
 	OBJ_PROGS =
 	PROGS =
@@ -52,7 +63,7 @@
 	# Don't run dependent parallel conjunction programs as they can cause
 	# deadlocks if there are not enough threads available.  This will be
 	# fixed with coroutining support.
-	OBJ_PROGS = $(DEP_PAR_CONJ_PROGS)
+	OBJ_PROGS = $(PROGS0) $(DEP_PAR_CONJ_PROGS)
 	PROGS = $(OBJ_PROGS) $(INDEP_PAR_CONJ_PROGS)
 endif
 
diff -u tests/par_conj/par_ddeath.m tests/par_conj/par_ddeath.m
--- tests/par_conj/par_ddeath.m	30 Jun 2006 11:42:42 -0000
+++ tests/par_conj/par_ddeath.m	3 Jul 2006 06:33:01 -0000
@@ -1,5 +1,8 @@
 % There was a problem with this file when --trace deep was used,
 % due to a bug in the --delay-death pass.
+% I'd made the delay death pass treat parallel conjunctions in
+% the same way as plain conjunctions, but that is all wrong
+% and causes this exception in the code generator.
 % 
 % Uncaught Mercury exception:
 % Software Error: map.lookup: key not found
diff -u tests/par_conj/par_ddeath_2.m tests/par_conj/par_ddeath_2.m
--- tests/par_conj/par_ddeath_2.m	30 Jun 2006 07:13:14 -0000
+++ tests/par_conj/par_ddeath_2.m	3 Jul 2006 07:08:16 -0000
@@ -1,4 +1,8 @@
 % With --trace deep --parallel
+% The incorrect deadness analysis of the parallel conjunction caused Result to
+% be added to the pre-death set of the else branch of the if-then-else.
+% When --delay-death is enabled (with --trace deep) it would result in the
+% following exception:
 %
 % Uncaught Mercury exception:
 % Software Error: liveness.m: Unexpected: branches of if-then-else disagree on liveness
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list