Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a reverse analysis phase to identify ptradd inlining.
In essence, this is the first commit towards moving us to "reverse code generation by stealth". After JIT IR is optimised, this commit changes things to a single reverse pass (previously we did a single forward pass). During that pass we: 1. Identify `PtrAdd` instructions which can be inlined by `Load`/`Store`. 2. Implicitly do a second round of dead-code elimination: currently this can only DCE some (not all!) `PtrAdd`s (those inlined by ykjit#1 that aren't used elsewhere). This turns out to be a much nicer way of optimised `PtrAdd`s than our previous attempts: the code is neater (though that doesn't mean it's not involved!) and it's also more effective because the register allocator now has less things it thinks are alive. Overall, this speeds up big_loop by about 10% because of the pressure it relieves from the register allocator. There is a lot of boring churn in tests because this forces us to `black_box` lots of tests in the code generator. Honestly, we should always have done that, but we got with it until now.
- Loading branch information