8cc icon indicating copy to clipboard operation
8cc copied to clipboard

Optimize some instruction sequences

Open binji opened this issue 5 years ago • 0 comments

The following operations are optimized:

  • push
  • do_emit_assign_deref
  • emit_pointer_arith
  • emit_ret
  • emit_copy_struct

Further optimizations can be done, but would require more information about which values are in which registers at a particular time, and which values need to be preserved across function calls (or by deferring code generation).

As an example of the improvement, the generated EIR files for the old version is 145868 lines of source, and the new version is 121844 lines.

binji avatar Jun 15 '20 17:06 binji