[llvm-commits] [llvm] r95130 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Blackfin/ lib/Target/CellSPU/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/

Dan Gohman gohman at apple.com
Tue Feb 2 13:34:55 PST 2010


On Feb 2, 2010, at 1:29 PM, Evan Cheng wrote:
> 
>     return true;
> 
>   // If the return types match, then it's safe.
> -  // Don't tail call optimize recursive call.
> -  GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee);
> -  if (!G) return false;  // FIXME: common external symbols?
> -  if (const Function *CalleeF = dyn_cast<Function>(G->getGlobal())) {
> -    const Type *CalleeRetTy = CalleeF->getReturnType();
> -    return CallerRetTy == CalleeRetTy;
> -  }
> -  return false;
> +  return CallerRetTy == RetTy;

Hi Evan,

This condition is already checked by target-independent code -- see
isInTailCallPosition in SelectionDAGBuilder.cpp -- so target-specific
code shouldn't need to worry about it.

Dan




More information about the llvm-commits mailing list