[llvm-commits] [llvm] r42870 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/X86/ test/CodeGen/X86/

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Fri Oct 12 08:21:31 PDT 2007


On 10/12/07, Duncan Sands <baldrick at free.fr> wrote:
> ... many comment corrections
Will correct them.
> Note that ECX may be used if there is a 'nest' parameter, see this line:
> +  // The 'nest' parameter, if any, is passed in ECX.
> +  CCIfNest<CCAssignToReg<[ECX]>>,
>
> How do you avoid collisions?
I don't. A copy paste error. But if i understand correctly the
CC_X86_32_C  calling convention does not prevent collisions either.

def CC_X86_32_C : CallingConv<[
  // Promote i8/i16 arguments to i32.
  CCIfType<[i8, i16], CCPromoteToType<i32>>,

  // The 'nest' parameter, if any, is passed in ECX.
  CCIfNest<CCAssignToReg<[ECX]>>,

  // The first 3 integer arguments, if marked 'inreg' and if the call is not
  // a vararg call, are passed in integer registers.
  CCIfNotVarArg<CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX, ECX]>>>>,

I would propose that tail call optimized fastcc functions do not
support nested functions. The other possiblity would be to reserve a
register for the nest parameter but then there is only one register
left for argument passing.

EAX used for nesting.
ECX used for possible function pointer to be called.
EDX (only register that can than be) used for inreg argument passing.

> Ciao,
>
>
> Duncan.
>

regards



More information about the llvm-commits mailing list