4 ms·
How do you access optimizations such as dead code removal and constant propagation using this technique?
by kzrdude 3y ago
How do you access optimizations such as dead code removal and constant propagation using this technique?
- SpaghettiCthulu 3y agoI believe a JIT using this technique could eliminate dead code at the Python bytecode level, but not at the machine code level. That seems pretty reasonable to me.
- kzrdude 3y agoNot sure, these optimizations multiply in power when used together. Propagate constants and fold constants, after that you can remove things like "if 0 > 0", both the conditional check and the whole block below it, and so on.
- SpaghettiCthulu 3y agoThat's entirely possible with the approach I described. Such optimizations can easily be done on the bytecode prior to the compilation to machine code.