Search in sources :

Example 1 with LoopEnd

use of com.dat3m.dartagnan.program.event.lang.svcomp.LoopEnd in project Dat3M by hernanponcedeleon.

the class FindSpinLoops method markAnnotatedSpinLoops.

private void markAnnotatedSpinLoops(Thread t) {
    Event pred = t.getEntry();
    Event curr = pred.getSuccessor();
    while (curr != null) {
        if (curr instanceof LoopEnd) {
            // This assume the following implementation of await_while
            // #define await_while(cond)                                                  \
            // for (int tmp = (__VERIFIER_loop_begin(), 0); __VERIFIER_spin_start(),  \
            // tmp = cond, __VERIFIER_spin_end(!tmp), tmp;)
            Event spinloop = curr.getSuccessors().stream().filter(e -> e instanceof CondJump && ((CondJump) e).isGoto()).findFirst().get();
            spinloop.addFilters(Tag.SPINLOOP, Tag.NOOPT);
            ((CondJump) spinloop).getLabel().addFilters(Tag.SPINLOOP, Tag.NOOPT);
            spinloops++;
        }
        curr = curr.getSuccessor();
    }
    t.clearCache();
}
Also used : LoopEnd(com.dat3m.dartagnan.program.event.lang.svcomp.LoopEnd) MemEvent(com.dat3m.dartagnan.program.event.core.MemEvent) Event(com.dat3m.dartagnan.program.event.core.Event) CondJump(com.dat3m.dartagnan.program.event.core.CondJump)

Aggregations

CondJump (com.dat3m.dartagnan.program.event.core.CondJump)1 Event (com.dat3m.dartagnan.program.event.core.Event)1 MemEvent (com.dat3m.dartagnan.program.event.core.MemEvent)1 LoopEnd (com.dat3m.dartagnan.program.event.lang.svcomp.LoopEnd)1