News for hackers. Stuff that matters.
Re:What Challenges and Trade-Offs Do Optimising Compilers Face? by chubot on Thursday June 22, 2017 @01:51PM (#14613994)
Yes I think this would be useful for solving the "order of optimization passes" problem. Right now I just treat my compiler as a black box. But if the guts were exposed a little bit, the compiler and I could work together to optimize a piece of code.

I could give it a few hints about what order might work, and it could show me what the intermediate representations are so that I can keep them in mind while writing code. There are patterns in C/C++ that trip up compilers, like unintentional aliasing or out params, and I could try to avoid them to help the optimizer. On the other hand, if the optimizer doesn't are, I will use them for my own convenience.

I suppose Clang has a pretty well-defined interface between passes, in the LLVM IR, so you can do this to some degree now. But it is a little obscure and probably version-dependent.

Re:What Challenges and Trade-Offs Do Optimising Compilers Face? by DerSaidin on Thursday June 22, 2017 @06:40PM (#14615869)
For a human reading LLVM IR, it hasn't changed much between versions since at least 2.6.
Re:What Challenges and Trade-Offs Do Optimising Compilers Face? by ChickeNES on Thursday June 22, 2017 @08:28PM (#14616317)
The problem is that there's no guarantee of stability in the IR, so either your stuck pinned to an old version of LLVM, or scrambling to keep up with each breaking change.