A parallelizing compiler generally works in two different ways:
1.Fully Automatic
The compiler analyzes the source code and identifies opportunities for parallelism.
The analysis includes identifying inhibitors to parallelism and possibly a cost weighting on whether or not the parallelism would actually improve performance.
Loops (do, for) are the most frequent target for automatic parallelization.
2.Programmer Directed
Using "compiler directives" or possibly compiler flags, the programmer explicitly tells the compiler how to parallelize the code.
May be able to be used in conjunction with some degree of automatic parallelization also.