|
Abstract.
Relaxed memory models reorder instructions in the interest of
performance. However, reordering of instructions can jeopardize
correctness and memory fences should be used to preserve specific
orders. Programs that carry explicit fences are over-specified as they
are tied to specific architectures and memory models and are hence
unportable. On the other hand, once the program specifies the
high-level required orders, optimizing compilers can allocate optimum
memory fences for multiple architectures. However, the fence insertion
problem for general programs is NP-hard. In this paper, we consider
fence insertion for straight-line programs. We
present a polynomial-time greedy algorithm via reduction to the chain
multi-cut problem.
|
|