Skip to content

Commit 23fd3a0

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (#2)
2 parents 9dfc289 + 7a2260f commit 23fd3a0

File tree

268 files changed

+9057
-2366
lines changed

Some content is hidden

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

268 files changed

+9057
-2366
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,12 +1153,12 @@ def SYCLIntelMaxGlobalWorkDim : InheritableAttr {
11531153
let PragmaAttributeSupport = 0;
11541154
}
11551155

1156-
def SYCLIntelUsesGlobalWorkOffset : InheritableAttr {
1157-
let Spellings = [CXX11<"intelfpga","uses_global_work_offset">];
1158-
let Args = [BoolArgument<"Enabled">];
1156+
def SYCLIntelNoGlobalWorkOffset : InheritableAttr {
1157+
let Spellings = [CXX11<"intelfpga","no_global_work_offset">];
1158+
let Args = [BoolArgument<"Enabled", 1>];
11591159
let LangOpts = [SYCLIsDevice, SYCLIsHost];
11601160
let Subjects = SubjectList<[Function], ErrorDiag>;
1161-
let Documentation = [SYCLIntelUsesGlobalWorkOffsetDocs];
1161+
let Documentation = [SYCLIntelNoGlobalWorkOffsetAttrDocs];
11621162
let PragmaAttributeSupport = 0;
11631163
}
11641164

clang/include/clang/Basic/AttrDocs.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,13 +2012,14 @@ device kernel, the attribute is ignored and it is not propagated to a kernel.
20122012
}];
20132013
}
20142014

2015-
def SYCLIntelUsesGlobalWorkOffsetDocs : Documentation {
2015+
def SYCLIntelNoGlobalWorkOffsetAttrDocs : Documentation {
20162016
let Category = DocCatFunction;
2017-
let Heading = "uses_global_work_offset (IntelFPGA)";
2017+
let Heading = "no_global_work_offset (IntelFPGA)";
20182018
let Content = [{
20192019
Applies to a device function/lambda function or function call operator (of a
2020-
function object). If 0, compiler doesn't use the global work offset values for
2021-
the device function. Valid values are 0 and 1.
2020+
function object). If 1, compiler doesn't use the global work offset values for
2021+
the device function. Valid values are 0 and 1. If used without argument, value
2022+
of 1 is set implicitly.
20222023
}];
20232024
}
20242025

clang/include/clang/Basic/AttributeCommonInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class AttributeCommonInfo {
159159
ParsedAttr == AT_SYCLIntelNumSimdWorkItems ||
160160
ParsedAttr == AT_SYCLIntelMaxWorkGroupSize ||
161161
ParsedAttr == AT_SYCLIntelMaxGlobalWorkDim ||
162-
ParsedAttr == AT_SYCLIntelUsesGlobalWorkOffset)
162+
ParsedAttr == AT_SYCLIntelNoGlobalWorkOffset)
163163
return true;
164164

165165
return false;

clang/include/clang/Driver/Action.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ class OffloadUnbundlingJobAction final : public JobAction {
613613

614614
public:
615615
// Offloading unbundling doesn't change the type of output.
616-
OffloadUnbundlingJobAction(ActionList &Inputs);
616+
OffloadUnbundlingJobAction(Action *Input);
617+
OffloadUnbundlingJobAction(ActionList &Inputs, types::ID Type);
617618

618619
/// Register information about a dependent action.
619620
void registerDependentActionInfo(const ToolChain *TC, StringRef BoundArch,

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def u_Group : OptionGroup<"<u group>">, Group<Link_Group>, DocFlatten;
197197
def reserved_lib_Group : OptionGroup<"<reserved libs group>">,
198198
Flags<[Unsupported]>;
199199

200+
def offload_lib_Group : OptionGroup<"<offload libs group>">;
201+
200202
// Temporary groups for clang options which we know we don't support,
201203
// but don't want to verbosely warn the user about.
202204
def clang_ignored_f_Group : OptionGroup<"<clang ignored f group>">,
@@ -1674,7 +1676,8 @@ def fobjc_nonfragile_abi : Flag<["-"], "fobjc-nonfragile-abi">, Group<f_Group>;
16741676
def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Group>;
16751677

16761678
def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
1677-
def foffload_static_lib_EQ : CommaJoined<["-"], "foffload-static-lib=">, Flags<[DriverOption, CoreOption]>;
1679+
def foffload_static_lib_EQ : CommaJoined<["-"], "foffload-static-lib=">, Flags<[DriverOption, CoreOption]>, Group<offload_lib_Group>;
1680+
def foffload_whole_static_lib_EQ : CommaJoined<["-"], "foffload-whole-static-lib=">, Flags<[DriverOption, CoreOption]>, Group<offload_lib_Group>;
16781681
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>;
16791682
def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
16801683
HelpText<"Parse OpenMP pragmas and generate parallel code.">;

clang/include/clang/Driver/Types.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ TYPE("tempfilelist", Tempfilelist, INVALID, "txt", phases
106106
TYPE("tempentriesfilelist", TempEntriesfilelist, INVALID, "txt", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
107107
TYPE("tempAOCOfilelist", TempAOCOfilelist, INVALID, "txt", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
108108
TYPE("archive", Archive, INVALID, "a", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
109+
TYPE("wholearchive", WholeArchive, INVALID, "a", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
109110
TYPE("fpga_aocx", FPGA_AOCX, INVALID, "aocx", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
110111
TYPE("fpga_aocr", FPGA_AOCR, INVALID, "aocr", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
111112
TYPE("fpga_aoco", FPGA_AOCO, INVALID, "aoco", phases::Compile, phases::Backend, phases::Assemble, phases::Link)

clang/include/clang/Driver/Types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ namespace types {
8484
/// isFPGA - Is this FPGA input.
8585
bool isFPGA(ID Id);
8686

87+
/// isArchive - Is this an archive input.
88+
bool isArchive(ID Id);
89+
8790
/// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
8891
bool isObjC(ID Id);
8992

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,67 +2456,6 @@ static bool isTypeSubstitutable(Qualifiers Quals, const Type *Ty,
24562456
return true;
24572457
}
24582458

2459-
namespace {
2460-
struct DeclContextDesc {
2461-
Decl::Kind DeclKind;
2462-
StringRef Name;
2463-
};
2464-
} // namespace
2465-
2466-
// For Scopes argument, the only supported Decl::Kind values are:
2467-
// - Namespace
2468-
// - CXXRecord
2469-
// - ClassTemplateSpecialization
2470-
static bool matchQualifiedTypeName(const QualType &Ty,
2471-
ArrayRef<DeclContextDesc> Scopes) {
2472-
// The idea: check the declaration context chain starting from the type
2473-
// itself. At each step check the context is of expected kind
2474-
// (namespace) and name.
2475-
const CXXRecordDecl *RecTy = Ty->getAsCXXRecordDecl();
2476-
2477-
if (!RecTy)
2478-
return false; // only classes/structs supported
2479-
const auto *Ctx = dyn_cast<DeclContext>(RecTy);
2480-
2481-
for (const auto &Scope : llvm::reverse(Scopes)) {
2482-
Decl::Kind DK = Ctx->getDeclKind();
2483-
StringRef Name = "";
2484-
2485-
if (DK != Scope.DeclKind)
2486-
return false;
2487-
2488-
switch (DK) {
2489-
case Decl::Kind::ClassTemplateSpecialization:
2490-
// ClassTemplateSpecializationDecl inherits from CXXRecordDecl
2491-
case Decl::Kind::CXXRecord:
2492-
Name = cast<CXXRecordDecl>(Ctx)->getName();
2493-
break;
2494-
case Decl::Kind::Namespace:
2495-
Name = cast<NamespaceDecl>(Ctx)->getName();
2496-
break;
2497-
default:
2498-
return false;
2499-
}
2500-
if (Name != Scope.Name)
2501-
return false;
2502-
Ctx = Ctx->getParent();
2503-
}
2504-
return Ctx->isTranslationUnit();
2505-
}
2506-
2507-
static bool isSYCLHostHalfType(const Type *Ty) {
2508-
// FIXME: this is not really portable, since the bunch of namespace below
2509-
// is not specified by the SYCL standard and highly depends on particular
2510-
// implementation
2511-
static const std::array<DeclContextDesc, 5> Scopes = {
2512-
DeclContextDesc{Decl::Kind::Namespace, "cl"},
2513-
DeclContextDesc{Decl::Kind::Namespace, "sycl"},
2514-
DeclContextDesc{Decl::Kind::Namespace, "detail"},
2515-
DeclContextDesc{Decl::Kind::Namespace, "half_impl"},
2516-
DeclContextDesc{Decl::Kind::CXXRecord, "half"}};
2517-
return matchQualifiedTypeName(QualType(Ty, 0), Scopes);
2518-
}
2519-
25202459
void CXXNameMangler::mangleType(QualType T) {
25212460
// If our type is instantiation-dependent but not dependent, we mangle
25222461
// it as it was written in the source, removing any top-level sugar.
@@ -2576,11 +2515,6 @@ void CXXNameMangler::mangleType(QualType T) {
25762515

25772516
bool isSubstitutable =
25782517
isTypeSubstitutable(quals, ty, Context.getASTContext());
2579-
if (Context.isUniqueNameMangler() && isSYCLHostHalfType(ty)) {
2580-
// Set isSubstitutable to false for cl::sycl::detail::half_impl::half
2581-
// to achieve the same mangling for other components
2582-
isSubstitutable = false;
2583-
}
25842518
if (isSubstitutable && mangleSubstitution(T))
25852519
return;
25862520

@@ -3057,11 +2991,6 @@ void CXXNameMangler::mangleType(const RecordType *T) {
30572991
mangleType(static_cast<const TagType*>(T));
30582992
}
30592993
void CXXNameMangler::mangleType(const TagType *T) {
3060-
if (Context.isUniqueNameMangler() && isSYCLHostHalfType(T)) {
3061-
// Mangle cl::sycl::detail::half_imple::half as _Float16
3062-
mangleType(Context.getASTContext().Float16Ty);
3063-
return;
3064-
}
30652994
mangleName(T->getDecl());
30662995
}
30672996

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -669,15 +669,10 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
669669
llvm::MDNode::get(Context, AttrMDArgs));
670670
}
671671

672-
if (const SYCLIntelUsesGlobalWorkOffsetAttr *A =
673-
FD->getAttr<SYCLIntelUsesGlobalWorkOffsetAttr>()) {
674-
bool IsEnabled = A->getEnabled();
675-
if (!IsEnabled) {
676-
llvm::Metadata *AttrMDArgs[] = {
677-
llvm::ConstantAsMetadata::get(Builder.getInt32(IsEnabled))};
678-
Fn->setMetadata("uses_global_work_offset",
679-
llvm::MDNode::get(Context, AttrMDArgs));
680-
}
672+
if (const SYCLIntelNoGlobalWorkOffsetAttr *A =
673+
FD->getAttr<SYCLIntelNoGlobalWorkOffsetAttr>()) {
674+
if (A->getEnabled())
675+
Fn->setMetadata("no_global_work_offset", llvm::MDNode::get(Context, {}));
681676
}
682677
}
683678

clang/lib/Driver/Action.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,12 @@ OffloadBundlingJobAction::OffloadBundlingJobAction(ActionList &Inputs)
421421

422422
void OffloadUnbundlingJobAction::anchor() {}
423423

424-
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(ActionList &Inputs)
425-
: JobAction(OffloadUnbundlingJobClass, Inputs, Inputs.back()->getType()) {}
424+
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input)
425+
: JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {}
426+
427+
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(ActionList &Inputs,
428+
types:: ID Type)
429+
: JobAction(OffloadUnbundlingJobClass, Inputs, Type) {}
426430

427431
void OffloadWrapperJobAction::anchor() {}
428432

0 commit comments

Comments
 (0)