Method and apparatus for simultaneous optimization of the compiler to
generate codes that may be compatible and acceptable for two or more
different processors without potentially sacrificing the performance on
any processors is provided. In particular, the rules of instructions
scheduling for the machines of interest of different processors are
abstracted. From the abstractions, a hypothetical machine is generated
that is the restrictive or constraining set of the actual machines
modeled in the abstraction step. After generating the hypothetical
machine, the restricted hypothetical machine is targeted rather than the
actual machines modeled in the first step. Thereafter, conflicts, if any
are resolved by modeling the performance impact and selecting the less
damaging choice. In this manner, by creating a hypothetical machine model
which incorporates the features of all target machines of interest and
which is more restrictive or constrained that the actual machines
modeled, it is possible to simultaneously optimize the code targeting
multiple machines.