Skip to main content
QUICK REVIEW

[Paper Review] Machine Code Optimization - Improving Executable Object Code

Clinton F. Goss|arXiv (Cornell University)|Aug 22, 2013
Parallel Computing and Optimization TechniquesComputer Science28 references6 citations
TL;DR

This paper presents machine code optimization techniques applicable after linking, focusing on improving executable object code when earlier compilation stages cannot apply certain optimizations. The approach uses retargetable, post-linking transformations to enhance performance and reduce size, with empirical results showing measurable gains in production software through a deployed implementation at New York University's Courant Institute.

ABSTRACT

This dissertation explores classes of compiler optimization techniques that are applicable late in the compilation process, after all executable code for a program has been linked. I concentrate on techniques which, for various reasons, cannot be applied earlier in the compilation process. In addition to a theoretical treatment of this class of optimization techniques, this dissertation reports on an implementation of these techniques in a production environment. I describe the details of the implementation which allows these techniques to be re-targeted easily and report on improvements gained when optimizing production software.

Motivation & Objective

  • To develop and implement machine code optimization techniques applicable after the linking phase, when earlier compiler optimizations are no longer feasible.
  • To address optimization opportunities that are inaccessible during traditional compilation due to symbol resolution, relocation, or code generation constraints.
  • To design a retargetable framework enabling easy adaptation of optimization techniques to different instruction sets and architectures.
  • To evaluate the effectiveness of these optimizations on real-world production software, measuring performance and size improvements.
  • To demonstrate practical deployment of post-linking optimization in a production environment with measurable benefits.

Proposed method

  • The paper introduces a retargetable optimization framework that operates on linked machine code, independent of the original source code.
  • It applies a suite of code transformation techniques—such as instruction scheduling, redundancy elimination, and instruction selection—directly on the final executable object code.
  • The framework uses a formal representation of machine instructions and semantics to ensure correctness during transformations.
  • Optimizations are applied after linking, leveraging information such as symbol addresses and relocation entries that are unavailable earlier.
  • The implementation supports multiple target architectures through modular, architecture-specific backends.
  • The system integrates with existing toolchains and operates as a post-processor on the final binary.

Experimental results

Research questions

  • RQ1What classes of optimization can be effectively applied after linking, when traditional compiler optimizations are no longer applicable?
  • RQ2How can machine code optimizations be made retargetable across different instruction set architectures?
  • RQ3What performance and size improvements can be achieved through post-linking optimization of real-world production software?
  • RQ4How can correctness be preserved when transforming low-level machine code without source-level context?
  • RQ5What are the practical challenges and benefits of deploying such optimizations in a production environment?

Key findings

  • The proposed optimization framework successfully improved executable size and performance on production software, demonstrating measurable gains in real-world workloads.
  • Post-linking optimizations achieved significant reductions in code size and execution time, particularly through instruction-level transformations and redundancy elimination.
  • The retargetable design enabled the framework to be adapted to multiple architectures with minimal changes to the core optimization engine.
  • The implementation proved robust in a production environment, with no observed correctness issues despite low-level code manipulation.
  • Empirical results from the technical report (NYU Courant, 1986) and revised version (2013) confirm consistent improvements across diverse software benchmarks.
  • The study confirms that valuable optimization opportunities exist in the final executable that are inaccessible during standard compilation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.