1. A method for compiling code, comprising: identifying critical sections in the code; minimizing the identified critical sections; and merging at least two of the critical sections based on the critical section minimization to improve parallel execution of the code.