1. A method of performing branch prediction in a computer program, comprising the steps of: associating one or more hardware counters with one or more branch instructions; using the one or more hardware counters, autonomically counting branch instructions that are executed to generate branch statistics; predicting branches to be taken using the branch statistics.