Skip to content

Commit fe8952f

Browse files
authored
Merge branch 'sycl' into commonhpp_reference_calculation_change
2 parents 1490375 + 100f89d commit fe8952f

File tree

359 files changed

+5735
-2740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+5735
-2740
lines changed

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ jobs:
301301

302302
- name: Attest Build Provenance
303303
id: provenance
304-
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
304+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
305305
with:
306306
subject-path: ${{ needs.prepare.outputs.release-binary-filename }}
307307

.github/workflows/release-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Attest Build Provenance
9393
if: github.event_name != 'pull_request'
9494
id: provenance
95-
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
95+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
9696
with:
9797
subject-path: "*.xz"
9898
- if: github.event_name != 'pull_request'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: SYCL Nightly Benchmarking
2+
3+
# Placeholder workflow for testing https://github.com/intel/llvm/pull/19280
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
do-nothing:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: echo "Test workflow for 19280"

clang/include/clang/Sema/SemaSYCL.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ class SemaSYCL : public SemaBase {
265265

266266
llvm::DenseSet<const FunctionDecl *> SYCLKernelFunctions;
267267

268+
llvm::DenseSet<const FunctionDecl *> FreeFunctionDeclarations;
269+
268270
public:
269271
SemaSYCL(Sema &S);
270272

@@ -357,7 +359,9 @@ class SemaSYCL : public SemaBase {
357359
void ConstructOpenCLKernel(FunctionDecl *KernelCallerFunc, MangleContext &MC);
358360
void SetSYCLKernelNames();
359361
void MarkDevices();
362+
void processFreeFunctionDeclaration(const FunctionDecl *FD);
360363
void ProcessFreeFunction(FunctionDecl *FD);
364+
void finalizeFreeFunctionKernels();
361365

362366
/// Get the number of fields or captures within the parsed type.
363367
ExprResult ActOnSYCLBuiltinNumFieldsExpr(ParsedType PT);

clang/lib/Basic/Targets.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
119119
return nullptr;
120120

121121
case llvm::Triple::UnknownArch:
122-
// native_cpu is only known to Clang, not to LLVM.
123-
if (Triple.str() == "native_cpu")
124-
return std::make_unique<NativeCPUTargetInfo>(Triple, Opts);
125-
126122
return nullptr;
127123

128124
case llvm::Triple::arc:
@@ -843,6 +839,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
843839

844840
case llvm::Triple::xtensa:
845841
return std::make_unique<XtensaTargetInfo>(Triple, Opts);
842+
843+
case llvm::Triple::native_cpu:
844+
return std::make_unique<NativeCPUTargetInfo>(Triple, Opts);
846845
}
847846
}
848847
} // namespace targets

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
19321932
// Implicit copy-assignment gets the same special treatment as implicit
19331933
// copy-constructors.
19341934
emitImplicitAssignmentOperatorBody(Args);
1935-
} else if (FD->hasAttr<OpenCLKernelAttr>() &&
1935+
} else if (getLangOpts().OpenCL && FD->hasAttr<OpenCLKernelAttr>() &&
19361936
GD.getKernelReferenceKind() == KernelReferenceKind::Kernel) {
19371937
CallArgList CallArgs;
19381938
for (unsigned i = 0; i < Args.size(); ++i) {

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4341,7 +4341,8 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
43414341

43424342
// Ignore declarations, they will be emitted on their first use.
43434343
if (const auto *FD = dyn_cast<FunctionDecl>(Global)) {
4344-
if (FD->hasAttr<OpenCLKernelAttr>() && FD->doesThisDeclarationHaveABody())
4344+
if (LangOpts.OpenCL && FD->hasAttr<OpenCLKernelAttr>() &&
4345+
FD->doesThisDeclarationHaveABody())
43454346
addDeferredDeclToEmit(GlobalDecl(FD, KernelReferenceKind::Stub));
43464347

43474348
// Update deferred annotations with the latest declaration if the function

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ unsigned TargetCodeGenInfo::getOpenCLKernelCallingConv() const {
119119

120120
void TargetCodeGenInfo::setOCLKernelStubCallingConvention(
121121
const FunctionType *&FT) const {
122-
123-
if (getABIInfo().getContext().getLangOpts().SYCLIsNativeCPU)
124-
return;
125-
126122
FT = getABIInfo().getContext().adjustFunctionType(
127123
FT, FT->getExtInfo().withCallingConv(CC_C));
128124
}

clang/lib/CodeGen/Targets/AMDGPU.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ class AMDGPUTargetCodeGenInfo : public TargetCodeGenInfo {
305305
void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
306306
CodeGen::CodeGenModule &M) const override;
307307
unsigned getOpenCLKernelCallingConv() const override;
308-
void
309-
setOCLKernelStubCallingConvention(const FunctionType *&FT) const override;
310308

311309
llvm::Constant *getNullPointer(const CodeGen::CodeGenModule &CGM,
312310
llvm::PointerType *T, QualType QT) const override;
@@ -437,14 +435,6 @@ unsigned AMDGPUTargetCodeGenInfo::getOpenCLKernelCallingConv() const {
437435
return llvm::CallingConv::AMDGPU_KERNEL;
438436
}
439437

440-
void AMDGPUTargetCodeGenInfo::setOCLKernelStubCallingConvention(
441-
const FunctionType *&FT) const {
442-
bool IsSYCL = getABIInfo().getContext().getLangOpts().isSYCL();
443-
FT = getABIInfo().getContext().adjustFunctionType(
444-
FT,
445-
FT->getExtInfo().withCallingConv(!IsSYCL ? CC_C : CC_AMDGPUKernelCall));
446-
}
447-
448438
// Currently LLVM assumes null pointers always have value 0,
449439
// which results in incorrectly transformed IR. Therefore, instead of
450440
// emitting null pointers in private and local address spaces, a null

clang/lib/CodeGen/Targets/SPIR.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,6 @@ void SPIRVTargetCodeGenInfo::setCUDAKernelCallingConvention(
394394

395395
void CommonSPIRTargetCodeGenInfo::setOCLKernelStubCallingConvention(
396396
const FunctionType *&FT) const {
397-
// Disable kernel stub for sycl
398-
if (getABIInfo().getContext().getLangOpts().isSYCL())
399-
return;
400397
FT = getABIInfo().getContext().adjustFunctionType(
401398
FT, FT->getExtInfo().withCallingConv(CC_SpirFunction));
402399
}

0 commit comments

Comments
 (0)