Coarse-grained speculative parallelism and optimization