If you have such a test suite then you really don't need AI to write the code for you.
func Benchmark(b *testing.B) {
for range b.N {
runCodeUnderBenchmark()
}
}
Actually optimizing the runCodeUnderBenchmark() function is far more difficult.