Skip to content

Commit 5e39487

Browse files
committed
Merge from 'sycl' to 'sycl-web' (#1)
CONFLICT (content): Merge conflict in clang/test/OpenMP/remarks_parallel_in_target_state_machine.c CONFLICT (content): Merge conflict in clang/test/OpenMP/remarks_parallel_in_multiple_target_state_machines.c
2 parents 54920b9 + 611746c commit 5e39487

File tree

59 files changed

+2645
-702
lines changed

Some content is hidden

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

59 files changed

+2645
-702
lines changed

clang/include/clang/Basic/Attr.td

+20-3
Original file line numberDiff line numberDiff line change
@@ -2975,10 +2975,27 @@ def ReqdWorkGroupSize : InheritableAttr {
29752975
def WorkGroupSizeHint : InheritableAttr {
29762976
let Spellings = [GNU<"work_group_size_hint">,
29772977
CXX11<"sycl", "work_group_size_hint">];
2978-
let Args = [UnsignedArgument<"XDim">,
2979-
UnsignedArgument<"YDim">,
2980-
UnsignedArgument<"ZDim">];
2978+
let Args = [ExprArgument<"XDim">,
2979+
ExprArgument<"YDim">,
2980+
ExprArgument<"ZDim">];
29812981
let Subjects = SubjectList<[Function], ErrorDiag>;
2982+
let AdditionalMembers = [{
2983+
Optional<llvm::APSInt> getXDimVal() const {
2984+
if (const auto *CE = dyn_cast<ConstantExpr>(getXDim()))
2985+
return CE->getResultAsAPSInt();
2986+
return None;
2987+
}
2988+
Optional<llvm::APSInt> getYDimVal() const {
2989+
if (const auto *CE = dyn_cast<ConstantExpr>(getYDim()))
2990+
return CE->getResultAsAPSInt();
2991+
return None;
2992+
}
2993+
Optional<llvm::APSInt> getZDimVal() const {
2994+
if (const auto *CE = dyn_cast<ConstantExpr>(getZDim()))
2995+
return CE->getResultAsAPSInt();
2996+
return None;
2997+
}
2998+
}];
29822999
let Documentation = [WorkGroupSizeHintAttrDocs];
29833000
}
29843001

clang/include/clang/Sema/Sema.h

+4
Original file line numberDiff line numberDiff line change
@@ -10320,6 +10320,10 @@ class Sema final {
1032010320
template <typename AttrType>
1032110321
void addIntelTripleArgAttr(Decl *D, const AttributeCommonInfo &CI,
1032210322
Expr *XDimExpr, Expr *YDimExpr, Expr *ZDimExpr);
10323+
void AddWorkGroupSizeHintAttr(Decl *D, const AttributeCommonInfo &CI,
10324+
Expr *XDim, Expr *YDim, Expr *ZDim);
10325+
WorkGroupSizeHintAttr *
10326+
MergeWorkGroupSizeHintAttr(Decl *D, const WorkGroupSizeHintAttr &A);
1032310327
void AddIntelReqdSubGroupSize(Decl *D, const AttributeCommonInfo &CI,
1032410328
Expr *E);
1032510329
IntelReqdSubGroupSizeAttr *

clang/lib/CodeGen/CGExpr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
38783878
Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(),
38793879
!getLangOpts().isSignedOverflowDefined(),
38803880
SignedIndices, E->getExprLoc(), &ptrType,
3881-
E->getBase(), "ptridx", PtrDecl);
3881+
E->getBase(), "arrayidx", PtrDecl);
38823882
}
38833883

38843884
LValue LV = MakeAddrLValue(Addr, E->getType(), EltBaseInfo, EltTBAAInfo);

clang/lib/CodeGen/CodeGenFunction.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,9 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
623623

624624
if (const WorkGroupSizeHintAttr *A = FD->getAttr<WorkGroupSizeHintAttr>()) {
625625
llvm::Metadata *AttrMDArgs[] = {
626-
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getXDim())),
627-
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getYDim())),
628-
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getZDim()))};
626+
llvm::ConstantAsMetadata::get(Builder.getInt(*A->getXDimVal())),
627+
llvm::ConstantAsMetadata::get(Builder.getInt(*A->getYDimVal())),
628+
llvm::ConstantAsMetadata::get(Builder.getInt(*A->getZDimVal()))};
629629
Fn->setMetadata("work_group_size_hint", llvm::MDNode::get(Context, AttrMDArgs));
630630
}
631631

clang/lib/Sema/SemaDecl.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,8 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
26432643
NewAttr = S.MergeIntelFPGAForcePow2DepthAttr(D, *A);
26442644
else if (const auto *A = dyn_cast<SYCLIntelFPGAInitiationIntervalAttr>(Attr))
26452645
NewAttr = S.MergeSYCLIntelFPGAInitiationIntervalAttr(D, *A);
2646+
else if (const auto *A = dyn_cast<WorkGroupSizeHintAttr>(Attr))
2647+
NewAttr = S.MergeWorkGroupSizeHintAttr(D, *A);
26462648
else if (Attr->shouldInheritEvenIfAlreadyPresent() || !DeclHasAttr(D, Attr))
26472649
NewAttr = cast<InheritableAttr>(Attr->clone(S.Context));
26482650

clang/lib/Sema/SemaDeclAttr.cpp

+100-18
Original file line numberDiff line numberDiff line change
@@ -3175,31 +3175,113 @@ static void handleWorkGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
31753175
S.addIntelTripleArgAttr<WorkGroupAttr>(D, AL, XDimExpr, YDimExpr, ZDimExpr);
31763176
}
31773177

3178-
// Handles work_group_size_hint.
3179-
static void handleWorkGroupSizeHint(Sema &S, Decl *D, const ParsedAttr &AL) {
3180-
S.CheckDeprecatedSYCLAttributeSpelling(AL);
3178+
// Returns a DupArgResult value; Same means the args have the same value,
3179+
// Different means the args do not have the same value, and Unknown means that
3180+
// the args cannot (yet) be compared.
3181+
enum class DupArgResult { Unknown, Same, Different };
3182+
static DupArgResult AreArgValuesIdentical(const Expr *LHS, const Expr *RHS) {
3183+
// If either operand is still value dependent, we can't test anything.
3184+
const auto *LHSCE = dyn_cast<ConstantExpr>(LHS);
3185+
const auto *RHSCE = dyn_cast<ConstantExpr>(RHS);
3186+
if (!LHSCE || !RHSCE)
3187+
return DupArgResult::Unknown;
3188+
3189+
// Otherwise, test that the values.
3190+
return LHSCE->getResultAsAPSInt() == RHSCE->getResultAsAPSInt()
3191+
? DupArgResult::Same
3192+
: DupArgResult::Different;
3193+
}
3194+
3195+
void Sema::AddWorkGroupSizeHintAttr(Decl *D, const AttributeCommonInfo &CI,
3196+
Expr *XDim, Expr *YDim, Expr *ZDim) {
3197+
// Returns nullptr if diagnosing, otherwise returns the original expression
3198+
// or the original expression converted to a constant expression.
3199+
auto CheckAndConvertArg = [&](Expr *E) -> Expr * {
3200+
// We can only check if the expression is not value dependent.
3201+
if (!E->isValueDependent()) {
3202+
llvm::APSInt ArgVal;
3203+
ExprResult Res = VerifyIntegerConstantExpression(E, &ArgVal);
3204+
if (Res.isInvalid())
3205+
return nullptr;
3206+
E = Res.get();
31813207

3182-
uint32_t WGSize[3];
3183-
for (unsigned i = 0; i < AL.getNumArgs(); ++i) {
3184-
if (!checkUInt32Argument(S, AL, AL.getArgAsExpr(i), WGSize[i], i,
3185-
/*StrictlyUnsigned=*/true))
3186-
return;
3208+
// This attribute requires a strictly positive value.
3209+
if (ArgVal <= 0) {
3210+
Diag(E->getExprLoc(), diag::err_attribute_requires_positive_integer)
3211+
<< CI << /*positive*/ 0;
3212+
return nullptr;
3213+
}
3214+
}
3215+
3216+
return E;
3217+
};
31873218

3188-
if (WGSize[i] == 0) {
3189-
S.Diag(AL.getLoc(), diag::err_attribute_argument_is_zero)
3190-
<< AL << AL.getArgAsExpr(i)->getSourceRange();
3219+
// Check all three argument values, and if any are bad, bail out. This will
3220+
// convert the given expressions into constant expressions when possible.
3221+
XDim = CheckAndConvertArg(XDim);
3222+
YDim = CheckAndConvertArg(YDim);
3223+
ZDim = CheckAndConvertArg(ZDim);
3224+
if (!XDim || !YDim || !ZDim)
3225+
return;
3226+
3227+
// If the attribute was already applied with different arguments, then
3228+
// diagnose the second attribute as a duplicate and don't add it.
3229+
if (const auto *Existing = D->getAttr<WorkGroupSizeHintAttr>()) {
3230+
DupArgResult Results[] = {AreArgValuesIdentical(XDim, Existing->getXDim()),
3231+
AreArgValuesIdentical(YDim, Existing->getYDim()),
3232+
AreArgValuesIdentical(ZDim, Existing->getZDim())};
3233+
// If any of the results are known to be different, we can diagnose at this
3234+
// point and drop the attribute.
3235+
if (llvm::is_contained(Results, DupArgResult::Different)) {
3236+
Diag(CI.getLoc(), diag::warn_duplicate_attribute) << CI;
3237+
Diag(Existing->getLoc(), diag::note_previous_attribute);
31913238
return;
31923239
}
3240+
// If all of the results are known to be the same, we can silently drop the
3241+
// attribute. Otherwise, we have to add the attribute and resolve its
3242+
// differences later.
3243+
if (llvm::all_of(Results,
3244+
[](DupArgResult V) { return V == DupArgResult::Same; }))
3245+
return;
31933246
}
31943247

3195-
WorkGroupSizeHintAttr *Existing = D->getAttr<WorkGroupSizeHintAttr>();
3196-
if (Existing &&
3197-
!(Existing->getXDim() == WGSize[0] && Existing->getYDim() == WGSize[1] &&
3198-
Existing->getZDim() == WGSize[2]))
3199-
S.Diag(AL.getLoc(), diag::warn_duplicate_attribute) << AL;
3248+
D->addAttr(::new (Context)
3249+
WorkGroupSizeHintAttr(Context, CI, XDim, YDim, ZDim));
3250+
}
3251+
3252+
WorkGroupSizeHintAttr *
3253+
Sema::MergeWorkGroupSizeHintAttr(Decl *D, const WorkGroupSizeHintAttr &A) {
3254+
// Check to see if there's a duplicate attribute already applied.
3255+
if (const auto *DeclAttr = D->getAttr<WorkGroupSizeHintAttr>()) {
3256+
DupArgResult Results[] = {
3257+
AreArgValuesIdentical(DeclAttr->getXDim(), A.getXDim()),
3258+
AreArgValuesIdentical(DeclAttr->getYDim(), A.getYDim()),
3259+
AreArgValuesIdentical(DeclAttr->getZDim(), A.getZDim())};
3260+
3261+
// If any of the results are known to be different, we can diagnose at this
3262+
// point and drop the attribute.
3263+
if (llvm::is_contained(Results, DupArgResult::Different)) {
3264+
Diag(DeclAttr->getLoc(), diag::warn_duplicate_attribute) << &A;
3265+
Diag(A.getLoc(), diag::note_previous_attribute);
3266+
return nullptr;
3267+
}
3268+
// If all of the results are known to be the same, we can silently drop the
3269+
// attribute. Otherwise, we have to add the attribute and resolve its
3270+
// differences later.
3271+
if (llvm::all_of(Results,
3272+
[](DupArgResult V) { return V == DupArgResult::Same; }))
3273+
return nullptr;
3274+
}
3275+
return ::new (Context)
3276+
WorkGroupSizeHintAttr(Context, A, A.getXDim(), A.getYDim(), A.getZDim());
3277+
}
3278+
3279+
// Handles work_group_size_hint.
3280+
static void handleWorkGroupSizeHint(Sema &S, Decl *D, const ParsedAttr &AL) {
3281+
S.CheckDeprecatedSYCLAttributeSpelling(AL);
32003282

3201-
D->addAttr(::new (S.Context) WorkGroupSizeHintAttr(S.Context, AL, WGSize[0],
3202-
WGSize[1], WGSize[2]));
3283+
S.AddWorkGroupSizeHintAttr(D, AL, AL.getArgAsExpr(0), AL.getArgAsExpr(1),
3284+
AL.getArgAsExpr(2));
32033285
}
32043286

32053287
void Sema::AddIntelReqdSubGroupSize(Decl *D, const AttributeCommonInfo &CI,

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,25 @@ static void instantiateSYCLIntelESimdVectorizeAttr(
743743
S.AddSYCLIntelESimdVectorizeAttr(New, *A, Result.getAs<Expr>());
744744
}
745745

746+
static void instantiateWorkGroupSizeHintAttr(
747+
Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs,
748+
const WorkGroupSizeHintAttr *A, Decl *New) {
749+
EnterExpressionEvaluationContext Unevaluated(
750+
S, Sema::ExpressionEvaluationContext::ConstantEvaluated);
751+
ExprResult XResult = S.SubstExpr(A->getXDim(), TemplateArgs);
752+
if (XResult.isInvalid())
753+
return;
754+
ExprResult YResult = S.SubstExpr(A->getYDim(), TemplateArgs);
755+
if (YResult.isInvalid())
756+
return;
757+
ExprResult ZResult = S.SubstExpr(A->getZDim(), TemplateArgs);
758+
if (ZResult.isInvalid())
759+
return;
760+
761+
S.AddWorkGroupSizeHintAttr(New, *A, XResult.get(), YResult.get(),
762+
ZResult.get());
763+
}
764+
746765
/// Determine whether the attribute A might be relevent to the declaration D.
747766
/// If not, we can skip instantiating it. The attribute may or may not have
748767
/// been instantiated yet.
@@ -986,6 +1005,10 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
9861005
SYCLIntelESimdVectorize, New);
9871006
continue;
9881007
}
1008+
if (const auto *A = dyn_cast<WorkGroupSizeHintAttr>(TmplAttr)) {
1009+
instantiateWorkGroupSizeHintAttr(*this, TemplateArgs, A, New);
1010+
continue;
1011+
}
9891012
// Existing DLL attribute on the instantiation takes precedence.
9901013
if (TmplAttr->getKind() == attr::DLLExport ||
9911014
TmplAttr->getKind() == attr::DLLImport) {

clang/test/CodeGenSYCL/intel-fpga-reg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ typedef int myInt;
195195
// CHECK-NEXT: store [[UNION__ZTS2UN_UN]] addrspace(4)* [[TMP69]], [[UNION__ZTS2UN_UN]] addrspace(4)* addrspace(4)* [[U3_ASCAST]], align 8, [[TBAA5]]
196196
// CHECK-NEXT: [[TMP70:%.*]] = bitcast %class._ZTS1A.A* [[CA]] to i8*
197197
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* [[TMP70]]) [[ATTR6]]
198-
// CHECK-NEXT: call spir_func void @_ZN1AC1Ei(%class._ZTS1A.A addrspace(4)* dereferenceable_or_null(4) [[CA_ASCAST]], i32 213) [[ATTR7:#.*]]
198+
// CHECK-NEXT: call spir_func void @_ZN1AC1Ei(%class._ZTS1A.A addrspace(4)* align 4 dereferenceable_or_null(4) [[CA_ASCAST]], i32 213) [[ATTR7:#.*]]
199199
// CHECK-NEXT: [[TMP71:%.*]] = bitcast %class._ZTS1A.A* [[CB]] to i8*
200200
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* [[TMP71]]) [[ATTR6]]
201201
// CHECK-NEXT: [[TMP72:%.*]] = bitcast [[CLASS__ZTS1A_A]] addrspace(4)* [[AGG_TEMP5_ASCAST]] to i8 addrspace(4)*

clang/test/CodeGenSYCL/kernel-handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void test(int val) {
2727
// NONATIVESUPPORT: %kh = alloca %"class.[[MANGLEDCLASS:[a-zA-Z0-9_]+]].cl::sycl::kernel_handler", align 1
2828
// NONATIVESUPPORT: %[[KH:[0-9]+]] = load i8 addrspace(1)*, i8 addrspace(1)** %_arg__specialization_constants_buffer.addr, align 8
2929
// NONATIVESUPPORT: %[[ADDRSPACECAST:[0-9]+]] = addrspacecast i8 addrspace(1)* %[[KH]] to i8*
30-
// NONATIVESUPPORT: call void @{{.*}}__init_specialization_constants_buffer{{.*}}(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler"* nonnull dereferenceable(1) %kh, i8* %[[ADDRSPACECAST]])
30+
// NONATIVESUPPORT: call void @{{.*}}__init_specialization_constants_buffer{{.*}}(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler"* nonnull align 1 dereferenceable(1) %kh, i8* %[[ADDRSPACECAST]])
3131
// NONATIVESUPPORT: void @"[[MANGLEDKERNELCALL:[a-zA-Z0-9_$]+]]"
3232
// NONATIVESUPPORT-SAME: byval(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler")
3333

clang/test/CodeGenSYCL/max-concurrency.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// CHECK: [[F1_ASCAST:%.*]] = addrspacecast [[CLASS_F1]]* [[F1]] to [[CLASS_F1]] addrspace(4)*
2525
// CHECK: [[TMP0:%.*]] = bitcast [[CLASS_F1]]* [[F1]] to i8*
2626
// CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[TMP0]])
27-
// CHECK: call spir_func void @_ZNK8Functor1clEv([[CLASS_F1]] addrspace(4)* dereferenceable_or_null(1) [[F1_ASCAST]])
27+
// CHECK: call spir_func void @_ZNK8Functor1clEv([[CLASS_F1]] addrspace(4)* align 1 dereferenceable_or_null(1) [[F1_ASCAST]])
2828
// CHECK: [[TMP1:%.*]] = bitcast [[CLASS_F1]]* [[F1]] to i8*
2929
// CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[TMP1]])
3030
// CHECK: ret void
@@ -35,7 +35,7 @@
3535
// CHECK: [[F3_ASCAST:%.*]] = addrspacecast [[CLASS_F3]]* [[F3]] to [[CLASS_F3]] addrspace(4)*
3636
// CHECK: [[TMP2:%.*]] = bitcast [[CLASS_F3]]* [[F3]] to i8*
3737
// CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[TMP2]])
38-
// CHECK: call spir_func void @_ZNK8Functor3ILi4EEclEv([[CLASS_F3]] addrspace(4)* dereferenceable_or_null(1) [[F3_ASCAST]])
38+
// CHECK: call spir_func void @_ZNK8Functor3ILi4EEclEv([[CLASS_F3]] addrspace(4)* align 1 dereferenceable_or_null(1) [[F3_ASCAST]])
3939
// CHECK: [[TMP3:%.*]] = bitcast [[CLASS_F3]]* [[F3]] to i8*
4040
// CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[TMP3]]
4141
// CHECK: ret void
@@ -54,7 +54,7 @@
5454
// CHECK: [[H2:%.*]] = addrspacecast [[H]]* [[H1]] to [[H]] addrspace(4)*
5555
// CHECK: [[H3:%.*]] = bitcast [[H]]* [[H1]] to i8*
5656
// CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[H3]])
57-
// CHECK: call spir_func void @"_ZZZ4mainENK3$_1clERN2cl4sycl7handlerEENKUlvE_clEv"([[H]] addrspace(4)* dereferenceable_or_null(1) [[H2]])
57+
// CHECK: call spir_func void @"_ZZZ4mainENK3$_1clERN2cl4sycl7handlerEENKUlvE_clEv"([[H]] addrspace(4)* align 1 dereferenceable_or_null(1) [[H2]])
5858
// CHECK: [[TMP4:%.*]] = bitcast [[H]]* [[H1]] to i8*
5959
// CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[TMP4]])
6060
// CHECK: ret void

clang/test/Driver/sycl.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
// ID_QUERIES: "-fsycl-id-queries-fit-in-int"
112112
// NO_ID_QUERIES: "-fno-sycl-id-queries-fit-in-int"
113113

114-
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
115-
// RUN: %clangxx -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
116-
// RUN: %clang_cl -### -fsycl -- %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
114+
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT_STD
115+
// RUN: %clangxx -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT_STD
116+
// RUN: %clang_cl -### -fsycl -- %s 2>&1 | FileCheck %s --check-prefix=DEFAULT_STD
117117

118-
// DEFAULT: "-sycl-std=2020"
118+
// DEFAULT_STD: "-sycl-std=2020"

clang/test/OpenMP/remarks_parallel_in_multiple_target_state_machines.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// XFAIL: *
2+
// Failure is expected until fixed in LLORG upstream.
3+
// TODO: remove XFAIL once the test starts to pass.
4+
15
// RUN: %clang_cc1 -verify=host -Rpass=openmp-opt -Rpass-analysis=openmp -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
26
// RUN: %clang_cc1 -verify=all,safe -Rpass=openmp-opt -Rpass-analysis=openmp -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out
37
// RUN: %clang_cc1 -fexperimental-new-pass-manager -verify=all,safe -Rpass=openmp-opt -Rpass-analysis=openmp -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out

clang/test/OpenMP/remarks_parallel_in_target_state_machine.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// XFAIL: *
2+
// Failure is expected until fixed in LLORG upstream.
3+
// TODO: remove XFAIL once the test starts to pass.
4+
15
// RUN: %clang_cc1 -verify=host -Rpass=openmp -Rpass-analysis=openmp-opt -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
26
// RUN: %clang_cc1 -verify -Rpass=openmp -Rpass-analysis=openmp-opt -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out
37
// RUN: %clang_cc1 -fexperimental-new-pass-manager -verify -Rpass=openmp -Rpass-analysis=openmp-opt -fopenmp -O2 -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t.out

clang/test/SemaOpenCL/invalid-kernel-attrs.cl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float)))
1212

1313
kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}}
1414

15-
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different arguments}}
15+
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different arguments}} expected-note {{previous attribute is here}}
1616

1717
__attribute__((reqd_work_group_size(8,16,32))) void kernel8(){} // expected-error {{attribute 'reqd_work_group_size' can only be applied to an OpenCL kernel}}
1818

@@ -42,7 +42,7 @@ kernel __attribute__((intel_reqd_sub_group_size(-1))) void kernel16() {} // expe
4242
kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel17() {} //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with different arguments}} \
4343
// expected-note {{previous attribute is here}}
4444

45-
__kernel __attribute__((work_group_size_hint(8,-16,32))) void neg1() {} //expected-error{{'work_group_size_hint' attribute requires a non-negative integral compile time constant expression}}
45+
__kernel __attribute__((work_group_size_hint(8,-16,32))) void neg1() {} //expected-error{{'work_group_size_hint' attribute requires a positive integral compile time constant expression}}
4646
__kernel __attribute__((reqd_work_group_size(8, 16, -32))) void neg2() {} //expected-warning{{implicit conversion changes signedness: 'int' to 'unsigned long long'}}
4747

4848
// 4294967294 is a negative integer if treated as signed.

0 commit comments

Comments
 (0)