Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions clang/lib/Basic/Targets/SPIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRTargetInfo
if (CC == CC_X86VectorCall)
// Permit CC_X86VectorCall which is used in Microsoft headers
return CCCR_OK;
return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
: CCCR_Warning;
return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
? CCCR_OK
: CCCR_Warning;
}
};

Expand Down Expand Up @@ -383,8 +384,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIR64TargetInfo
// Permit CC_X86RegCall which is used to mark external functions with
// explicit simd or structure type arguments to pass them via registers.
return CCCR_OK;
return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
: CCCR_Warning;
return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
? CCCR_OK
: CCCR_Warning;
}

bool
Expand Down Expand Up @@ -432,8 +434,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIR64TargetInfo
}

CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
: CCCR_Warning;
return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
? CCCR_OK
: CCCR_Warning;
}
};

Expand Down Expand Up @@ -616,8 +619,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRV32TargetInfo
if (CC == CC_X86VectorCall)
// Permit CC_X86VectorCall which is used in Microsoft headers
return CCCR_OK;
return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
: CCCR_Warning;
return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
? CCCR_OK
: CCCR_Warning;
}
};

Expand Down Expand Up @@ -666,8 +670,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIRV64TargetInfo
// Permit CC_X86RegCall which is used to mark external functions with
// explicit simd or structure type arguments to pass them via registers.
return CCCR_OK;
return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK
: CCCR_Warning;
return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel)
? CCCR_OK
: CCCR_Warning;
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv32 -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify
// RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv64 -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify
// RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv64-amd-amdhsa -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify

Expand Down