[MLton] Shortening dependency chains in the x86 codegen

Wesley W. Terpstra wesley at terpstra.ca
Sat Feb 17 17:02:10 PST 2007


Bump. Did anyone ever try this?

On Jan 7, 2007, at 5:57 PM, Vesa Karvonen wrote:
> The pattern pointed out by the comments is
>
>  First  movl regA,regB
>  then   op   ????,regB
>  and continue to use both regA and regB.
>
> This is problematic, because there is a "dependency chain" on  
> regB.  Copying
> regA to regB must be executed before the operation on regB and the  
> subsequent
> operations reading regB are also delayed.
>
> It would be better to transform the pattern to
>
>  First  movl regA,regB
>  then   op   ????,regA
>  and continue to use both regA and regB, where the roles of regA  
> and regB
>  have been swapped.
>
> IOW, the idea is to systematically, after a register-to-register copy,
> swap the roles of the registers, so that the target of the copy  
> isn't the
> target (or source) of the subsequent op.




More information about the MLton mailing list