[LLVMdev] X86 -tailcallopt and C calling conversion

NAKAMURA Takumi geek4civic at gmail.com
Sat Jan 1 16:20:46 PST 2011


Happy 2011, everybody!

It seems -tailcallopt prevents tailcall optimization when both caller
and callee have ccc,
even when it is optimized without an option -tailcallopt.
Is it intended or misoptimized?

In X86ISelLowering.cpp:X86TargetLowering::IsEligibleForTailCallOptimization():

  if (GuaranteedTailCallOpt) {
    if (IsTailCallConvention(CalleeCC) && CCMatch)
      return true;
    return false;
  }

I know -tailcallopt changes calling conversion of fastcc to callee-pop.

ps. I am tweaking tailcallopt on Win64.

...Takumi



More information about the llvm-dev mailing list