We currently build interpreters with -O0 so that passes that break mapping don't run. This obviously slows down interpreters a lot.
We can in fact tolerate many optimisation passes, but we don't yet know which.
I'd recommend tackling this in two stages:
Turn on all IR-level optimisations. We should be able to tolerate al of these, since the IR and blockmap embedded in the interpreter binary will reflect those mutations.
Do something clever (possibly using an automated brute force tool) to turn on a bunch of MIR passes that we can tolerate.
For the former we may be able to do something like:
Add a flag -yk-disable-incompat-opts
Let the pass manager build the pipeline as it normally would
Afterwards, if -yk-disable-incompat-opts is set, do a isa<MachineFunctionPass> (maybe others?) check on each pass, and remove those that are machine passes.
We currently build interpreters with
-O0
so that passes that break mapping don't run. This obviously slows down interpreters a lot.We can in fact tolerate many optimisation passes, but we don't yet know which.
I'd recommend tackling this in two stages:
For the former we may be able to do something like:
-yk-disable-incompat-opts
-yk-disable-incompat-opts
is set, do aisa<MachineFunctionPass>
(maybe others?) check on each pass, and remove those that are machine passes.