A method to optimize speculative parallel thread execution comprises
selecting a plurality of partition candidate pairs for speculative
parallel thread execution, transforming each partition candidate pair of
the plurality of partition candidate pairs to improve the expected
performance gain of each pair, and selecting a set of one or more
transformed partition candidate pairs that do not interfere with each
other and produce a maximum expected performance gain.