use of com.dat3m.dartagnan.program.analysis.ExecutionAnalysis in project Dat3M by hernanponcedeleon.
the class Relation method removeMutuallyExclusiveTuples.
protected void removeMutuallyExclusiveTuples(Set<Tuple> tupleSet) {
ExecutionAnalysis exec = analysisContext.requires(ExecutionAnalysis.class);
tupleSet.removeIf(t -> exec.areMutuallyExclusive(t.getFirst(), t.getSecond()));
}
use of com.dat3m.dartagnan.program.analysis.ExecutionAnalysis in project Dat3M by hernanponcedeleon.
the class RelFencerel method getMinTupleSet.
@Override
public TupleSet getMinTupleSet() {
if (minTupleSet == null) {
ExecutionAnalysis exec = analysisContext.get(ExecutionAnalysis.class);
minTupleSet = new TupleSet();
for (Thread t : task.getProgram().getThreads()) {
List<Event> fences = t.getCache().getEvents(FilterBasic.get(fenceName));
List<Event> memEvents = t.getCache().getEvents(FilterBasic.get(Tag.MEMORY));
for (Event fence : fences) {
int numEventsBeforeFence = (int) memEvents.stream().mapToInt(Event::getCId).filter(id -> id < fence.getCId()).count();
List<Event> eventsBefore = memEvents.subList(0, numEventsBeforeFence);
List<Event> eventsAfter = memEvents.subList(numEventsBeforeFence, memEvents.size());
for (Event e1 : eventsBefore) {
boolean isImpliedByE1 = exec.isImplied(e1, fence);
for (Event e2 : eventsAfter) {
if (isImpliedByE1 || exec.isImplied(e2, fence)) {
minTupleSet.add(new Tuple(e1, e2));
}
}
}
}
}
removeMutuallyExclusiveTuples(minTupleSet);
}
return minTupleSet;
}
use of com.dat3m.dartagnan.program.analysis.ExecutionAnalysis in project Dat3M by hernanponcedeleon.
the class RelComposition method getMinTupleSet.
@Override
public TupleSet getMinTupleSet() {
if (minTupleSet == null) {
ExecutionAnalysis exec = analysisContext.get(ExecutionAnalysis.class);
minTupleSet = r1.getMinTupleSet().postComposition(r2.getMinTupleSet(), (t1, t2) -> exec.isImplied(t1.getFirst(), t1.getSecond()) || exec.isImplied(t2.getSecond(), t1.getSecond()));
removeMutuallyExclusiveTuples(minTupleSet);
}
return minTupleSet;
}
use of com.dat3m.dartagnan.program.analysis.ExecutionAnalysis in project Dat3M by hernanponcedeleon.
the class RelComposition method getMaxTupleSetRecursive.
@Override
public TupleSet getMaxTupleSetRecursive() {
if (recursiveGroupId > 0 && maxTupleSet != null) {
ExecutionAnalysis exec = analysisContext.get(ExecutionAnalysis.class);
maxTupleSet = r1.getMaxTupleSetRecursive().postComposition(r2.getMaxTupleSetRecursive(), (t1, t2) -> !exec.areMutuallyExclusive(t1.getFirst(), t2.getSecond()));
return maxTupleSet;
}
return getMaxTupleSet();
}
Aggregations