Re:Cranelift code generation comes to Rust
by MaxBarraclough on Tuesday March 19, 2024 @04:46PM
(#39760030)
As I understand it they just aren't very practical. Perhaps you could use a superoptimizer in a targeted way, assuming that:
1. The codebase has hot loops of very short sequences (or can be automatically reshaped into this patten)
2. The superoptimising compiler can produce code that significantly outperforms the code generated by ordinary optimising compilers
3. A practical superoptimising compiler exists
I can imagine these assumptions may not hold in practice.
> the compiler can validate the optimizations
A compiler transforms code from one representation to another, it doesn't validate arbitrary transformations.
It's not easy to prove that a given fragment of source-code corresponds to some given assembly code. I've heard of only one instance of this being done. [0]
1. The codebase has hot loops of very short sequences (or can be automatically reshaped into this patten)
2. The superoptimising compiler can produce code that significantly outperforms the code generated by ordinary optimising compilers
3. A practical superoptimising compiler exists
I can imagine these assumptions may not hold in practice.
> the compiler can validate the optimizations
A compiler transforms code from one representation to another, it doesn't validate arbitrary transformations.
It's not easy to prove that a given fragment of source-code corresponds to some given assembly code. I've heard of only one instance of this being done. [0]
> untill the preconditions hold
I'm not sure what you mean by this.
[0] https://entropy2018.sciencesconf.org/data/myreen.pdf