Extract optimization pass selection code from llvm-gcc into a separate routine.