Add an instruction shrinking pass.
When an instruction has multiple valid encodings, such as with and without a REX prefix on x86-64, Cretonne typically picks the encoding which gives the register allocator the most flexibility, which is typically the longest encoding. This patch adds a pass that runs after register allocation that picks the smallest encoding, working within the constraints of the register allocator's choices. The result is smaller and easier to read encodings. In the future, we may want to merge this pass into the relaxation pass, or possibly fold it into the final encoding step, however for now, a discrete pass will suffice.
This commit is contained in:
@@ -5,9 +5,11 @@
|
||||
|
||||
mod memorysink;
|
||||
mod relaxation;
|
||||
mod shrink;
|
||||
|
||||
pub use self::memorysink::{MemoryCodeSink, RelocSink, TrapSink, NullTrapSink};
|
||||
pub use self::relaxation::relax_branches;
|
||||
pub use self::shrink::shrink_instructions;
|
||||
pub use regalloc::RegDiversions;
|
||||
|
||||
use ir::{ExternalName, Function, Inst, JumpTable, SourceLoc, TrapCode};
|
||||
|
||||
Reference in New Issue
Block a user