1. A method for counting speculatively-executed instructions for performance analysis purposes, comprising: counting instructions which are normally executed during a normal-execution mode on a processor; entering a speculative-execution mode wherein instructions are speculatively executed without being committed to the architectural state of the processor; and counting the speculatively-executed instructions during the speculative-execution mode in a manner that enables the count of speculatively-executed instructions to be reset if the speculative execution fails.