A method and apparatus for providing compiler transformation of code using regions
with simplified data and control flow and value specialization are described. In
one embodiment, the method includes identifying in the code a plurality of potential
candidates for value specialization, selecting a group of candidates from the plurality
of potential candidates based on a value profile associated with each potential
candidate, and determining specialized data for each selected candidate using a
corresponding value profile. The method further includes forming a plurality of
optimized regions based on corresponding specialized data. Each optimized region
includes one or more selected candidates.