Tim> Excellent advice that almost nobody follows <0.5 wink>: choose a Tim> flexible intermediate representation, then structure all your Tim> transformations as independent passes, such that the output of Tim> every pass is acceptable as the input to every pass. I did this with my peephole optimizer. It worked great. Each peephole optimization is a very simple subclass of an OptimizeFilter base class. The IR is essentially the bytecode split into basic blocks, with each basic block a list of (opcode argument) tuples. Jump targets are represented as simple indexes into the block list. (In fact, my Rattlesnake converter was just a "peephole optimizer" named InstructionSetConverter.) As Tim mentioned about KISS, this means you sometimes have to run particular optimizations or groups of optimizations multiple times. I want to get it checked into the sandbox where others can play with it, but time has shifted its foundation a tad and a couple optimizations don't work any longer. Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4