I am looking into ML for generating more efficient code (i.e. compile time and run time heuristics). I have a phd (compilers, hpc), but very little ML experience.

I would appreciate any references to existing work.

More importantly, which Machine Learning techniques should i be exploring ?

  • each data sample is a code + test run + performance data
  • large number of data samples, with correct labeling
  • large number of parameters to modify
  • any sample can be rerun with any parameters (and get correct labeling)
  • large amount of cpu to run and re run samples

And also some of my very suspect assumptions...

  • much of the code is already locally-optimal (basic compiler optimization)
  • some of the parameters are "high level concepts" e.g. replace array with linked list. (so a small parameter change will have varied effects)
  • the desired improvement is bounded (a xK improvement is "good enough", K is well known)
  • the parameters are sparse i.e. mostly zero (i suspect that most code is basically good, and there are relatively few beneficial changes)

Any pointers to set me on my way would be appreciated

  • $\begingroup$ Sounds like you are asking for references to any papers in compiler design. There are many. $\endgroup$ Mar 13, 2012 at 13:57
  • 1
    $\begingroup$ Absolutely not! I looking at heuristics which are completely outside compiler design. These heuristic constitute a very large problem space, and cannot be be easily analyzed even in runtime, hence ML. $\endgroup$
    – OA1
    Mar 13, 2012 at 14:44
  • 1
    $\begingroup$ you should probably go to metaoptimize.com. This question is out of scope here. $\endgroup$ Mar 13, 2012 at 17:38
  • 6
    $\begingroup$ I realized that “ML” in the question does not mean what I thought it meant. $\endgroup$ Mar 13, 2012 at 17:49
  • $\begingroup$ @TsuyoshiIto I would say that these technics could be landed into Virtual Machine, not the compiler itself $\endgroup$
    – om-nom-nom
    Mar 13, 2012 at 20:25

1 Answer 1


Genetic Programming (GP) has been used to modify source code for performance improvement.

e.g. Evolutionary Improvement of Programs

(This is close to my PhD topic, would be very interested to hear your approach)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.