OSDN Git Service

Corrected many typing errors. And removed 'nest' parameter handling
authorArnold Schwaighofer <arnold.schwaighofer@gmail.com>
Fri, 12 Oct 2007 21:30:57 +0000 (21:30 +0000)
committerArnold Schwaighofer <arnold.schwaighofer@gmail.com>
Fri, 12 Oct 2007 21:30:57 +0000 (21:30 +0000)
for fastcc from X86CallingConv.td.  This means that nested functions
are not supported for calling convention 'fastcc'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42934 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
include/llvm/Target/TargetLowering.h
include/llvm/Target/TargetOptions.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/X86/README.txt
lib/Target/X86/X86.td
lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrFPStack.td
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrSSE.td
lib/Target/X86/X86InstrX86-64.td
lib/Target/X86/X86RegisterInfo.td

index 1352eaf..e1fa226 100644 (file)
@@ -861,8 +861,8 @@ public:
   virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
 
   /// IsEligibleForTailCallOptimization - Check whether the call is eligible for
-  /// tail call optimization. Target which want to do tail call optimization
-  /// should implement this function. 
+  /// tail call optimization. Targets which want to do tail call optimization
+  /// should override this function. 
   virtual bool IsEligibleForTailCallOptimization(SDOperand Call, 
                                                  SDOperand Ret, 
                                                  SelectionDAG &DAG) const {
index dd54432..1b90d46 100644 (file)
@@ -74,9 +74,9 @@ namespace llvm {
   /// be emitted.
   extern bool ExceptionHandling;
 
-  /// PerformTailCallOpt - This flag is enabled when the -tailcallopt is
-  /// specified on the commandline. When the flag is on, the target will perform
-  /// tail call optimization (pop the caller's stack) providing it supports it.
+  /// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified
+  /// on the commandline. When the flag is on, the target will perform tail call
+  /// optimization (pop the caller's stack) providing it supports it.
   extern bool PerformTailCallOpt;
 } // End llvm namespace
 
index c63386c..55251c2 100644 (file)
@@ -4476,7 +4476,7 @@ static void copyCatchInfo(BasicBlock *SrcBB, BasicBlock *DestBB,
 }
 
 /// CheckDAGForTailCallsAndFixThem - This Function looks for CALL nodes in the
-/// DAG and fixes their tailcall attribute operand
+/// DAG and fixes their tailcall attribute operand.
 static void CheckDAGForTailCallsAndFixThem(SelectionDAG &DAG, 
                                            TargetLowering& TLI) {
   SDNode * Ret = NULL;
@@ -4497,7 +4497,7 @@ static void CheckDAGForTailCallsAndFixThem(SelectionDAG &DAG,
         cast<ConstantSDNode>(OpCall.getOperand(3))->getValue() != 0;
       // If CALL node has tail call attribute set to true and the call is not
       // eligible (no RET or the target rejects) the attribute is fixed to
-      // false.  The TargetLowering::IsEligibleForTailCallOptimization function
+      // false. The TargetLowering::IsEligibleForTailCallOptimization function
       // must correctly identify tail call optimizable calls.
       if (isMarkedTailCall && 
           (Ret==NULL || 
index 9cb01a7..ccd15be 100644 (file)
@@ -1352,14 +1352,15 @@ L7:
 L5:
 
 //===---------------------------------------------------------------------===//
+
 Tail call optimization improvements: Tail call optimization currently
-pushes all arguments on the top of the stack (their normal place if
-that was a not tail call optimized functiong call ) before moving them
-to actual stack slot. this is done to prevent overwriting of paramters
-(see example below) that might be used, since the arguments of the
-callee overwrites callers arguments.
+pushes all arguments on the top of the stack (their normal place for
+non-tail call optimized calls) before moving them to actual stack
+slot. This is done to prevent overwriting of parameters (see example
+below) that might be used, since the arguments of the callee
+overwrites caller's arguments.
 
- example:  
+example:  
 
 int callee(int32, int64); 
 int caller(int32 arg1, int32 arg2) { 
@@ -1371,39 +1372,41 @@ int caller(int32 arg1, int32 arg2) {
 [arg2]      ->  [(int64)
 [RETADDR]        local  ]
 
-moving arg1 onto the stack slot of callee function would overwrite
+Moving arg1 onto the stack slot of callee function would overwrite
 arg2 of the caller.
 
 Possible optimizations:
 
- - only push those arguments to the top of the stack that are actual
+ - Only push those arguments to the top of the stack that are actual
    parameters of the caller function and have no local value in the
-   caller
+   caller.
 
-   in above example local does not need to be pushed onto the top of
-   the stack as it is definitetly not a caller's function parameter
+   In the above example local does not need to be pushed onto the top
+   of the stack as it is definitely not a caller's function
+   parameter.
 
- - analyse the actual parameters of the callee to see which would
-   overwrite a caller paramter which is used by the callee and only
-   push them onto the top of the stack
+ - Analyse the actual parameters of the callee to see which would
+   overwrite a caller parameter which is used by the callee and only
+   push them onto the top of the stack.
 
    int callee (int32 arg1, int32 arg2);
    int caller (int32 arg1, int32 arg2) {
        return callee(arg1,arg2);
    }
 
-   here we don't need to write any variables to the top of the stack
-   since they don't overwrite each other
+   Here we don't need to write any variables to the top of the stack
+   since they don't overwrite each other.
 
    int callee (int32 arg1, int32 arg2);
    int caller (int32 arg1, int32 arg2) {
        return callee(arg2,arg1);
    }
 
-   here we need to push the arguments because they overwrite each other
+   Here we need to push the arguments because they overwrite each
+   other.
 
 
-   code for lowering directly onto callers arguments:
+   Code for lowering directly onto callers arguments:
 +  SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass;
 +  SmallVector<SDOperand, 8> MemOpChains;
 +
index 98362c8..423c77e 100644 (file)
@@ -1,4 +1,4 @@
-//===- X86.td - Target definition file for the Intel X86 arch ---*- C++ -*-===//
+//===- X86.td - Target definition file for the Intel X86 ---*- tablegen -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
index f23e580..525967a 100644 (file)
@@ -1,4 +1,4 @@
-//===- X86CallingConv.td - Calling Conventions for X86 32/64 ----*- C++ -*-===//
+//===- X86CallingConv.td - Calling Conventions X86 32/64 ---*- tablegen -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
@@ -127,7 +127,7 @@ def CC_X86_64_C : CallingConv<[
   CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 8>>
 ]>;
 
-// tail call convetion (fast) one register is reserved for target address
+// Tail call convention (fast): One register is reserved for target address,
 // namely R9
 def CC_X86_64_TailCall : CallingConv<[
   // Promote i8/i16 arguments to i32.
@@ -207,15 +207,14 @@ def CC_X86_32_C : CallingConv<[
   CCDelegateTo<CC_X86_32_Common>
 ]>;
 
-/// Same as C calling convention up to nonfree ECX which is used for storing 
-/// potential pointer to tail called function
+/// Same as C calling convention except for non-free ECX which is used for storing 
+/// a potential pointer to the tail called function.
 def CC_X86_32_TailCall : CallingConv<[
   // Promote i8/i16 arguments to i32.
   CCIfType<[i8, i16], CCPromoteToType<i32>>,
 
-  // The 'nest' parameter, if any, is passed in ECX.
-  CCIfNest<CCAssignToReg<[ECX]>>,
-
+  // Nested functions are currently not supported by fastcc.
+  
   // 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]>>>>,
index 894faa3..b35e1e6 100644 (file)
@@ -1,4 +1,4 @@
-//===-- X86ISelLowering.cpp - X86 DAG Lowering Implementation -------------===//
+//===-- X86isellowering.cpp - X86 DAG Lowering Implementation -------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -1402,13 +1402,12 @@ SDOperand X86TargetLowering::LowerFastCCCallTo(SDOperand Op, SelectionDAG &DAG,
 //                * elf/pic is disabled OR
 //                * elf/pic enabled + callee is in module + callee has
 //                  visibility protected or hidden
-//  To ensure the stack is aligned according to platform abi pass
-//  tail-call-align-stack. This makes sure that argument delta is always
-//  multiples of stack alignment. (Dynamic linkers need this - darwin's dyld for
-//  example)
+//  To keep the stack aligned according to platform abi the function
+//  GetAlignedArgumentStackSize ensures that argument delta is always multiples
+//  of stack alignment. (Dynamic linkers need this - darwin's dyld for example)
 //  If a tail called function callee has more arguments than the caller the
 //  caller needs to make sure that there is room to move the RETADDR to. This is
-//  achived by reserving an area the size of the argument delta right after the
+//  achieved by reserving an area the size of the argument delta right after the
 //  original REtADDR, but before the saved framepointer or the spilled registers
 //  e.g. caller(arg1, arg2) calls callee(arg1, arg2,arg3,arg4)
 //  stack layout:
index a26a4ff..8ce8cdf 100644 (file)
@@ -1,4 +1,4 @@
-//==- X86InstrFPStack.td - Describe the X86 Instruction Set -------*- C++ -*-=//
+//==- X86InstrFPStack.td - Describe the X86 Instruction Set --*- tablegen -*-=//
 // 
 //                     The LLVM Compiler Infrastructure
 //
index a6bd3fb..6302024 100644 (file)
@@ -1,4 +1,4 @@
-//===- X86InstrInfo.td - Describe the X86 Instruction Set -------*- C++ -*-===//
+//===- X86InstrInfo.td - Describe the X86 Instruction Set --*- tablegen -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
index bbcc753..7c19473 100644 (file)
@@ -1,4 +1,4 @@
-//====- X86InstrSSE.td - Describe the X86 Instruction Set -------*- C++ -*-===//
+//====- X86InstrSSE.td - Describe the X86 Instruction Set --*- tablegen -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
index f501b5e..077e9dc 100644 (file)
@@ -1,4 +1,4 @@
-//====- X86InstrX86-64.td - Describe the X86 Instruction Set ----*- C++ -*-===//
+//====- X86InstrX86-64.td - Describe the X86 Instr. Set ----*- tablegen -*-===//
 // 
 //                     The LLVM Compiler Infrastructure
 //
index d8bbbd5..2ebc8ab 100644 (file)
@@ -1,4 +1,4 @@
-//===- X86RegisterInfo.td - Describe the X86 Register File ------*- C++ -*-===//
+//===- X86RegisterInfo.td - Describe the X86 Register File --*- tablegen -*-==//
 // 
 //                     The LLVM Compiler Infrastructure
 //