[llvm-commits] [llvm] r106621 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td

Dan Gohman gohman at apple.com
Wed Jun 23 13:23:18 PDT 2010


On Jun 23, 2010, at 1:01 AM, Eric Christopher wrote:

> Author: echristo
> Date: Wed Jun 23 03:01:49 2010
> New Revision: 106621
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=106621&view=rev
> Log:
> Update uses, defs, and comments for darwin tls patterns.
> 
> Modified:
>    llvm/trunk/lib/Target/X86/X86Instr64bit.td
>    llvm/trunk/lib/Target/X86/X86InstrInfo.td
> 
> Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106621&r1=106620&r2=106621&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original)
> +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jun 23 03:01:49 2010
> @@ -1705,13 +1705,10 @@
>                   [(X86tlsaddr tls64addr:$sym)]>,
>                   Requires<[In64BitMode]>;
> 
> 
> -// FIXME: Not true for darwin
> -let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0,
> -            MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
> -            XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
> -            XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS],
> -    Uses = [ESP],
> +// For i386, the address of the thunk is passed on the stack, on return the 
> +// address of the variable is in %eax.  %ecx is trashed during the function 
> +// call.  %edx is preserved.
> +let Defs = [EAX],
> +    Uses = [ESP, ECX],

If ecx is trashed, it should be listed as a Def, and not as a Use.

Also, if all the other registers are preserved, please mention that
explicitly, as that's a non-obvious difference from regular calls.

>     usesCustomInserter = 1 in
> def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym),
>                 "# Fixme into a call",

Please add comments noting that this and TLSCall_64 are Darwin-specific.

Please don't put "Fixme" in the string there. Just put "# TLSCall" or
whatever, as the other Pseudo instructions do.

Thanks,

Dan





More information about the llvm-commits mailing list