4 ms·
Compilers seem a great target for AI. Whole program optimisation using reinforcement learning could be massive, there's plenty of data, and collecting more data
by fancyfredbot 3y ago
Compilers seem a great target for AI. Whole program optimisation using reinforcement learning could be massive, there's plenty of data, and collecting more data is relatively cheap. The course touches on superoptimisers but these don't really use AI. I think a change is coming in this space
- layer8 3y agoHow would you prove the resulting program is functionally still the same?
- danybittel 3y agoYou don't have to go that far. A compiler contains a lot of heuristics, I could see ai being useful for that.
- sabas123 3y agoThose heuristics are about "when" to apply certain transformations in a situation when two options are already proven equivalent. That is different from transforming correct code into possibly incorrect code.
- mgaunard 3y agoAI could be used to choose which of the valid transformations to apply and in which order. Current compilers do not guarantee that re-running the optimization passes a second time is idempotent. Every pass just does some "useful" transformations, it's best-effort.
- fancyfredbot 3y agoAs others have commented, it would be more like deciding which optimisation passes to run and in which order. Things like loop unrolling and inlining are not always helpful. Things like polyhedral optimization can be very slow. Running every optimization pass every time it might help is certainly far too slow.
- bregma 3y agoAI os great for compiler optimization as long as it's OK that the rule that functionality can't be observably changed gets broken. Drop in a modern AI as the optimizer and every single line of C++ code can be considered undefined behaviour.