Skip to content

Commit 4b9ab3e

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents cdabc42 + 8149957 commit 4b9ab3e

27 files changed

+153
-39
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8651,10 +8651,8 @@ void Sema::ProcessDeclAttributeList(Scope *S, Decl *D,
86518651
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
86528652
D->setInvalidDecl();
86538653
} else if (const auto *A = D->getAttr<IntelReqdSubGroupSizeAttr>()) {
8654-
if (!getLangOpts().SYCLIsDevice) {
8655-
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
8656-
D->setInvalidDecl();
8657-
}
8654+
Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A;
8655+
D->setInvalidDecl();
86588656
} else if (!D->hasAttr<CUDAGlobalAttr>()) {
86598657
if (const auto *A = D->getAttr<AMDGPUFlatWorkGroupSizeAttr>()) {
86608658
Diag(D->getLocation(), diag::err_attribute_wrong_decl_type)

llvm-spirv/lib/SPIRV/LLVMToSPIRVDbgTran.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "SPIRVWriter.h"
4040

4141
#include "llvm/IR/DebugInfo.h"
42+
#include "llvm/IR/DebugInfoMetadata.h"
4243

4344
using namespace SPIRV;
4445

llvm-spirv/lib/SPIRV/LLVMToSPIRVDbgTran.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include "llvm/IR/DebugInfo.h"
4444
#include "llvm/IR/Module.h"
4545

46-
#include <memory>
47-
4846
using namespace llvm;
4947

5048
namespace SPIRV {

llvm-spirv/lib/SPIRV/Mangler/Mangler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "ManglingUtils.h"
1515
#include "NameMangleAPI.h"
1616
#include "ParameterType.h"
17-
#include "SPIRVInternal.h"
1817
#include <algorithm>
1918
#include <map>
2019
#include <sstream>

llvm-spirv/lib/SPIRV/OCL20ToSPIRV.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/Instruction.h"
5050
#include "llvm/IR/Instructions.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/Debug.h"
5253

5354
#include <algorithm>
5455
#include <set>
@@ -329,7 +330,7 @@ bool OCL20ToSPIRV::runOnModule(Module &Module) {
329330
return false;
330331

331332
CLVer = std::get<1>(Src);
332-
if (CLVer > kOCLVer::CL20)
333+
if (CLVer == kOCLVer::CL21)
333334
return false;
334335

335336
LLVM_DEBUG(dbgs() << "Enter OCL20ToSPIRV:\n");
@@ -406,7 +407,8 @@ void OCL20ToSPIRV::visitCallInst(CallInst &CI) {
406407
DemangledName == kOCLBuiltinName::AtomicCmpXchgStrong ||
407408
DemangledName == kOCLBuiltinName::AtomicCmpXchgWeakExplicit ||
408409
DemangledName == kOCLBuiltinName::AtomicCmpXchgStrongExplicit) {
409-
assert(CLVer == kOCLVer::CL20 && "Wrong version of OpenCL");
410+
assert((CLVer == kOCLVer::CL20 || CLVer == kOCLVer::CL30) &&
411+
"Wrong version of OpenCL");
410412
PCI = visitCallAtomicCmpXchg(PCI);
411413
}
412414
visitCallAtomicLegacy(PCI, MangledName, DemangledName);

llvm-spirv/lib/SPIRV/OCL21ToSPIRV.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "llvm/IR/InstVisitor.h"
4747
#include "llvm/IR/Instructions.h"
4848
#include "llvm/Pass.h"
49+
#include "llvm/Support/Debug.h"
4950

5051
#include <set>
5152

@@ -107,7 +108,7 @@ bool OCL21ToSPIRV::runOnModule(Module &Module) {
107108
return false;
108109

109110
CLVer = std::get<1>(Src);
110-
if (CLVer < kOCLVer::CL21)
111+
if (CLVer != kOCLVer::CL21)
111112
return false;
112113

113114
LLVM_DEBUG(dbgs() << "Enter OCL21ToSPIRV:\n");

llvm-spirv/lib/SPIRV/OCLUtil.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141

4242
#include "SPIRVInternal.h"
4343
#include "llvm/ADT/SmallString.h"
44-
#include "llvm/ADT/SmallString.h"
45-
#include "llvm/IR/DebugInfoMetadata.h"
4644
#include "llvm/IR/IRBuilder.h"
4745
#include "llvm/IR/Instructions.h"
4846
#include "llvm/Support/Path.h"
@@ -321,6 +319,7 @@ namespace kOCLVer {
321319
const unsigned CL12 = 102000;
322320
const unsigned CL20 = 200000;
323321
const unsigned CL21 = 201000;
322+
const unsigned CL30 = 300000;
324323
} // namespace kOCLVer
325324

326325
namespace OclExt {

llvm-spirv/lib/SPIRV/PreprocessMetadata.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/IRBuilder.h"
5050
#include "llvm/IR/InstVisitor.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/CommandLine.h"
5253

5354
using namespace llvm;
5455
using namespace SPIRV;
@@ -207,8 +208,8 @@ void PreprocessMetadata::preprocessOCLMetadata(Module *M, SPIRVMDBuilder *B,
207208
// !{x} = !{i32 3, i32 102000}
208209
B->addNamedMD(kSPIRVMD::Source)
209210
.addOp()
210-
.add(CLVer < kOCLVer::CL21 ? spv::SourceLanguageOpenCL_C
211-
: spv::SourceLanguageOpenCL_CPP)
211+
.add(CLVer == kOCLVer::CL21 ? spv::SourceLanguageOpenCL_CPP
212+
: spv::SourceLanguageOpenCL_C)
212213
.add(CLVer)
213214
.done();
214215
if (EraseOCLMD)

llvm-spirv/lib/SPIRV/SPIRVLowerConstExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/InstVisitor.h"
5050
#include "llvm/IR/Instructions.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/CommandLine.h"
5253

5354
#include <list>
5455
#include <set>

llvm-spirv/lib/SPIRV/SPIRVLowerSaddWithOverflow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "llvm/IRReader/IRReader.h"
5252
#include "llvm/Linker/Linker.h"
5353
#include "llvm/Pass.h"
54+
#include "llvm/Support/SourceMgr.h"
5455

5556
using namespace llvm;
5657
using namespace SPIRV;

0 commit comments

Comments
 (0)