r226558 - Reverting r226548 as one of the tests fails in some configurations.

Alexander Kornienko alexfh at google.com
Tue Jan 20 02:55:34 PST 2015


Author: alexfh
Date: Tue Jan 20 04:55:33 2015
New Revision: 226558

URL: http://llvm.org/viewvc/llvm-project?rev=226558&view=rev
Log:
Reverting r226548 as one of the tests fails in some configurations.

Here's the fail log from our internal setup:
===
  .../tools/clang/clang -cc1 -internal-isystem .../tools/clang/staging/include -nostdsysteminc .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl -triple spir-unknown-unknown -emit-llvm -o -
  FileCheck .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl
.../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl:11:12: error: expected string not found in input
 // CHECK: %call = tail call spir_func i32 @get_dummy_id(i32 0)
           ^
<stdin>:6:52: note: scanning from here
define spir_kernel void @foo(i32 addrspace(1)* %A) #0 {
                                                   ^
<stdin>:7:2: note: possible intended match here
 %1 = tail call spir_func i32 @get_dummy_id(i32 0) #2
 ^
===

Here's a failure on a public CI server:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/1183/


Removed:
    cfe/trunk/test/CodeGenOpenCL/spir-calling-conv.cl
Modified:
    cfe/trunk/include/clang/Basic/Specifiers.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/AST/TypePrinter.cpp
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/tools/libclang/CXType.cpp

Modified: cfe/trunk/include/clang/Basic/Specifiers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Specifiers.h?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Specifiers.h (original)
+++ cfe/trunk/include/clang/Basic/Specifiers.h Tue Jan 20 04:55:33 2015
@@ -210,9 +210,7 @@ namespace clang {
     CC_AAPCS,       // __attribute__((pcs("aapcs")))
     CC_AAPCS_VFP,   // __attribute__((pcs("aapcs-vfp")))
     CC_PnaclCall,   // __attribute__((pnaclcall))
-    CC_IntelOclBicc, // __attribute__((intel_ocl_bicc))
-    CC_SpirFunction, // default for OpenCL functions on SPIR target
-    CC_SpirKernel    // inferred for OpenCL kernels on SPIR target
+    CC_IntelOclBicc // __attribute__((intel_ocl_bicc))
   };
 
   /// \brief Checks whether the given calling convention supports variadic
@@ -224,8 +222,6 @@ namespace clang {
     case CC_X86ThisCall:
     case CC_X86Pascal:
     case CC_X86VectorCall:
-    case CC_SpirFunction:
-    case CC_SpirKernel:
       return false;
     default:
       return true;

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Jan 20 04:55:33 2015
@@ -8043,9 +8043,7 @@ CallingConv ASTContext::getDefaultCallin
   if (IsCXXMethod)
     return ABI->getDefaultMethodCallConv(IsVariadic);
 
-  if (LangOpts.MRTD && !IsVariadic) return CC_X86StdCall;
-
-  return Target->getDefaultCallingConv(TargetInfo::CCMT_Unknown);
+  return (LangOpts.MRTD && !IsVariadic) ? CC_X86StdCall : CC_C;
 }
 
 bool ASTContext::isNearlyEmpty(const CXXRecordDecl *RD) const {

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Tue Jan 20 04:55:33 2015
@@ -1588,8 +1588,6 @@ StringRef FunctionType::getNameForCallCo
   case CC_AAPCS_VFP: return "aapcs-vfp";
   case CC_PnaclCall: return "pnaclcall";
   case CC_IntelOclBicc: return "intel_ocl_bicc";
-  case CC_SpirFunction: return "spir_function";
-  case CC_SpirKernel: return "spir_kernel";
   }
 
   llvm_unreachable("Invalid calling convention.");

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Tue Jan 20 04:55:33 2015
@@ -697,10 +697,6 @@ void TypePrinter::printFunctionProtoAfte
     case CC_X86_64SysV:
       OS << " __attribute__((sysv_abi))";
       break;
-    case CC_SpirFunction:
-    case CC_SpirKernel:
-      // Do nothing. These CCs are not available as attributes.
-      break;
     }
   }
 

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Jan 20 04:55:33 2015
@@ -6346,15 +6346,6 @@ namespace {
     BuiltinVaListKind getBuiltinVaListKind() const override {
       return TargetInfo::VoidPtrBuiltinVaList;
     }
-
-    CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
-      return (CC == CC_SpirFunction ||
-              CC == CC_SpirKernel) ? CCCR_OK : CCCR_Warning;
-    }
-
-    CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
-      return CC_SpirFunction;
-    }
   };
 
 

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Tue Jan 20 04:55:33 2015
@@ -51,8 +51,6 @@ static unsigned ClangCallConvToLLVMCallC
   case CC_X86Pascal: return llvm::CallingConv::C;
   // TODO: Add support for __vectorcall to LLVM.
   case CC_X86VectorCall: return llvm::CallingConv::X86_VectorCall;
-  case CC_SpirFunction: return llvm::CallingConv::SPIR_FUNC;
-  case CC_SpirKernel: return llvm::CallingConv::SPIR_KERNEL;
   }
 }
 

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Jan 20 04:55:33 2015
@@ -2476,24 +2476,8 @@ getCCForDeclaratorChunk(Sema &S, Declara
     }
   }
 
-  CallingConv CC = S.Context.getDefaultCallingConvention(FTI.isVariadic,
-                                                         IsCXXInstanceMethod);
-
-  // Attribute AT_OpenCLKernel affects the calling convention only on
-  // the SPIR target, hence it cannot be treated as a calling
-  // convention attribute. This is the simplest place to infer
-  // "spir_kernel" for OpenCL kernels on SPIR.
-  if (CC == CC_SpirFunction) {
-    for (const AttributeList *Attr = D.getDeclSpec().getAttributes().getList();
-         Attr; Attr = Attr->getNext()) {
-      if (Attr->getKind() == AttributeList::AT_OpenCLKernel) {
-        CC = CC_SpirKernel;
-        break;
-      }
-    }
-  }
-
-  return CC;
+  return S.Context.getDefaultCallingConvention(FTI.isVariadic,
+                                               IsCXXInstanceMethod);
 }
 
 static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,

Removed: cfe/trunk/test/CodeGenOpenCL/spir-calling-conv.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/spir-calling-conv.cl?rev=226557&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/spir-calling-conv.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/spir-calling-conv.cl (removed)
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 %s -triple "spir-unknown-unknown" -emit-llvm -o - | FileCheck %s
-
-int get_dummy_id(int D);
-
-kernel void bar(global int *A);
-
-kernel void foo(global int *A)
-// CHECK: define spir_kernel void @foo(i32 addrspace(1)* %A)
-{
-  int id = get_dummy_id(0);
-  // CHECK: %call = tail call spir_func i32 @get_dummy_id(i32 0)
-  A[id] = id;
-  bar(A);
-  // CHECK: tail call spir_kernel void @bar(i32 addrspace(1)* %A)
-}
-
-// CHECK: declare spir_func i32 @get_dummy_id(i32)
-// CHECK: declare spir_kernel void @bar(i32 addrspace(1)*)

Modified: cfe/trunk/tools/libclang/CXType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=226558&r1=226557&r2=226558&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXType.cpp (original)
+++ cfe/trunk/tools/libclang/CXType.cpp Tue Jan 20 04:55:33 2015
@@ -527,9 +527,6 @@ CXCallingConv clang_getFunctionTypeCalli
       TCALLINGCONV(AAPCS_VFP);
       TCALLINGCONV(PnaclCall);
       TCALLINGCONV(IntelOclBicc);
-    case CC_SpirFunction: return CXCallingConv_Unexposed;
-    case CC_SpirKernel: return CXCallingConv_Unexposed;
-      break;
     }
 #undef TCALLINGCONV
   }





More information about the cfe-commits mailing list