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:
@@ -228,4 +228,4 @@ ebb4:
|
||||
|
||||
; check: function %divert
|
||||
; check: regmove v5, %rcx -> %rbx
|
||||
; check: [RexOp1popq#58,%rbx] v15 = x86_pop.i64
|
||||
; check: [Op1popq#58,%rbx] v15 = x86_pop.i64
|
||||
|
||||
Reference in New Issue
Block a user