There is provided a method, system and program storage device for
utilizing a hardware performance monitors for improving performance of an
application comprising a plurality of instructions while the application
is executing on a micro-architecture, comprising: creating a machine
internal representation (MIR) for the plurality of instructions or a
subset thereof for the hardware and generating an executable (EXE) from
the MIR for execution on the hardware; determining hardware performance
monitor (HPM) information for an event associated with a resource of the
hardware during execution of the EXE to identify one or more instructions
of the application that affect the execution of the application on the
hardware; re-computing the MIR according to the HPM information; and
re-generating the EXE from the re-computed MIR for execution on the
hardware if the MIR and the re-computed MIR are different, thereby
improving utilization of the resource by the application. Also provided
is a hardware performance monitor (HPM) subsystem for improving
performance of an application comprising a plurality of instructions
while the application is executing on a hardware.