mypy
3c99f126 - [mypyc] Refactor mypyc.ir.ops: replace LoadInt with Integer (#9859)

Commit
5 years ago
[mypyc] Refactor mypyc.ir.ops: replace LoadInt with Integer (#9859) The new class is a direct subclass of `Value` instead of an `Op` subclass. It essentially changes integers from operations to literals. The main benefit is that IR generation is a bit easier, as `Integer` instances no longer must be added to a basic block. We can also get rid of some special treatment of `LoadInt` in IR pretty printing and C generation. Liveness analysis and some other analyses may also become faster, since they don't need to track the lifetimes of integers, and there are fewer ops for which data flow information needs to be calculated. Integers no longer have interesting lifetimes, since they are treated as "pure values" and always directly associated with the `Op` that uses them. I couldn't measure a performance improvement, however, so the impact may be negligible or non-existent. This may also make some IR optimizations slightly easier to implement. Work on mypyc/mypyc#781.
Author
Parents
Loading