Methods and apparatus for merging critical sections are disclosed. An
example disclosed system estimates the cost of merging a first critical
section and a second critical section using a dataflow analysis on the
first and second critical sections. In the example system, the first
critical section and the second critical section are merged based on a
least expensive cost of merging critical sections.