From: jjenista Date: Wed, 30 Jun 2010 18:51:43 +0000 (+0000) Subject: debugged the reach graph support for effect conflicts X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c9ee914aa7578140e25a86956fef7451d9fe229a;p=IRC.git debugged the reach graph support for effect conflicts --- diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index 5d44e8b4..10617e11 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -4727,7 +4727,7 @@ public class ReachGraph { while( rtItr2.hasNext() ) { ReachTuple rt2 = rtItr2.next(); - if( hrn.getAlpha().getStatesWithBoth( rt1, rt2 ) != null ) { + if( !hrn.getAlpha().getStatesWithBoth( rt1, rt2 ).isEmpty() ) { return true; } } @@ -4779,7 +4779,7 @@ public class ReachGraph { continue; } - if( hrn.getAlpha().getStatesWithBoth( rt1, rt2 ) != null ) { + if( !hrn.getAlpha().getStatesWithBoth( rt1, rt2 ).isEmpty() ) { return true; } } diff --git a/Robust/src/Analysis/OoOJava/ConflictGraph.java b/Robust/src/Analysis/OoOJava/ConflictGraph.java index 9a65b158..f889a799 100644 --- a/Robust/src/Analysis/OoOJava/ConflictGraph.java +++ b/Robust/src/Analysis/OoOJava/ConflictGraph.java @@ -368,19 +368,20 @@ public class ConflictGraph { FlatNew fnRoot1 = asA.getFlatNew(); FlatNew fnRoot2 = asB.getFlatNew(); FlatNew fnTarget = effectA.getAffectedAllocSite().getFlatNew(); - if (da.mayBothReachTarget(fmEnclosing, fnRoot1, fnRoot2, fnTarget)) { - if (fnRoot1.equals(fnRoot2)) { - if (!da.mayManyReachTarget(fmEnclosing, fnRoot1, fnTarget)) { - // fine-grained conflict case - conflictType = - updateConflictType(conflictType, ConflictGraph.FINE_GRAIN_EDGE); - } else { - conflictType = - updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE); - } + if (fnRoot1.equals(fnRoot2)) { + if (!da.mayManyReachTarget(fmEnclosing, fnRoot1, fnTarget)) { + // fine-grained conflict case + conflictType = + updateConflictType(conflictType, ConflictGraph.FINE_GRAIN_EDGE); } else { conflictType = - updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE); + updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE); + } + } else { + if (da.mayBothReachTarget(fmEnclosing, fnRoot1, fnRoot2, fnTarget)) { + conflictType = + updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE); + } else { } } } else { diff --git a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java index 217f8266..e687d61a 100644 --- a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java +++ b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java @@ -225,7 +225,7 @@ public class OoOJavaAnalysis { null, // don't do effects analysis again! null // don't do effects analysis again! ); -writeConflictGraph(); + //writeConflictGraph(); // 10th pass, calculate conflicts with reachability info calculateConflicts(null, true); diff --git a/Robust/src/Makefile b/Robust/src/Makefile index 15920cac..fda0ec2f 100644 --- a/Robust/src/Makefile +++ b/Robust/src/Makefile @@ -194,7 +194,7 @@ clean: rm -f IR/*.class IR/Tree/*.class Main/*.class Lex/*.class Parse/*.class Parse/Sym.java Parse/Parser.java IR/Flat/*.class classdefs.h methodheaders.h methods.c structdefs.h virtualtable.h task.h taskdefs.c taskdefs.h Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class cleanclass: - rm -f IR/*.class IR/Tree/*.class Main/*.class IR/Flat/*.class Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class + rm -f IR/*.class IR/Tree/*.class Main/*.class IR/Flat/*.class Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class cleandoc: rm -rf javadoc diff --git a/Robust/src/Tests/disjoint/effectConflictSupportTest/makefile b/Robust/src/Tests/disjoint/effectConflictSupportTest/makefile new file mode 100644 index 00000000..ca5e7b05 --- /dev/null +++ b/Robust/src/Tests/disjoint/effectConflictSupportTest/makefile @@ -0,0 +1,30 @@ +PROGRAM=test + +SOURCE_FILES=$(PROGRAM).java + +BUILDSCRIPT=~/research/Robust/src/buildscript + +BSFLAGS= -mainclass Test -joptimize -justanalyze -ooojava -disjoint -disjoint-k 1 -enable-assertions +DEBUGFLAGS= -disjoint-write-dots final #-disjoint-write-initial-contexts -disjoint-write-ihms -disjoint-debug-snap-method main 0 10 true + +all: $(PROGRAM).bin + +view: PNGs + eog *.png & + +PNGs: DOTs + d2p *COMPLETE*.dot + +DOTs: $(PROGRAM).bin + +$(PROGRAM).bin: $(SOURCE_FILES) + $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES) + +clean: + rm -f $(PROGRAM).bin + rm -fr tmpbuilddirectory + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f aliases.txt + rm -f effects.txt diff --git a/Robust/src/Tests/disjoint/effectConflictSupportTest/test.java b/Robust/src/Tests/disjoint/effectConflictSupportTest/test.java new file mode 100644 index 00000000..9857f23c --- /dev/null +++ b/Robust/src/Tests/disjoint/effectConflictSupportTest/test.java @@ -0,0 +1,39 @@ +public class Foo { + public Foo() {} + public Foo f; + public Foo g; + public int v; +} + +public class Test { + + static public void main( String[] args ) { + + Foo r1 = new Foo(); + Foo r2 = new Foo(); + + Foo a = null; + + while( false ) { + + r2.f = r1.f; + + if( true ) { + r1.f = a; + } + + a = new Foo(); + } + + rblock r1 { + + rblock c1 { + r1.f.v = 1; + } + + r2.f.v = 2; + } + + + } +}