Skip to content

Commit 508bc05

Browse files
committed
Resolve merge conflicts
1 parent 9c1cb8a commit 508bc05

19 files changed

Lines changed: 3 additions & 691 deletions

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,18 +2038,6 @@ def SYCLIntelNoGlobalWorkOffset : InheritableAttr {
20382038
let SupportsNonconformingLambdaSyntax = 1;
20392039
}
20402040

2041-
def SYCLIntelLoopFuse : InheritableAttr {
2042-
let Spellings = [CXX11<"intel", "loop_fuse">,
2043-
CXX11<"intel", "loop_fuse_independent">];
2044-
let Args = [ExprArgument<"Value", /*optional=*/ 1>];
2045-
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
2046-
let Subjects = SubjectList<[Function], ErrorDiag>;
2047-
let Accessors = [Accessor<"isIndependent",
2048-
[CXX11<"intel", "loop_fuse_independent">]>];
2049-
let Documentation = [SYCLIntelLoopFuseDocs];
2050-
let SupportsNonconformingLambdaSyntax = 1;
2051-
}
2052-
20532041
class SYCLAddIRAttrMemberCodeHolder<code Code> {
20542042
code MemberCode = Code;
20552043
}
@@ -3043,14 +3031,6 @@ def SYCLIntelSpeculatedIterations : StmtAttr {
30433031
def : MutualExclusions<[SYCLIntelDisableLoopPipelining,
30443032
SYCLIntelSpeculatedIterations]>;
30453033

3046-
def SYCLIntelNofusion : StmtAttr {
3047-
let Spellings = [CXX11<"intel","nofusion">];
3048-
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],
3049-
ErrorDiag, "'for', 'while', and 'do' statements">;
3050-
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
3051-
let Documentation = [SYCLIntelNofusionAttrDocs];
3052-
}
3053-
30543034
def SYCLIntelMaxReinvocationDelay : StmtAttr {
30553035
let Spellings = [CXX11<"intel", "max_reinvocation_delay">];
30563036
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],

clang/include/clang/Basic/AttrDocs.td

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,30 +4226,6 @@ used on the same loop in conjunction with disable_loop_pipelining.
42264226
}];
42274227
}
42284228

4229-
def SYCLIntelNofusionAttrDocs : Documentation {
4230-
let Category = DocCatVariable;
4231-
let Heading = "intel::nofusion";
4232-
let Content = [{
4233-
This attribute applies to a loop. Indicates that the annotated
4234-
loop should not be fused with any adjacent loop.
4235-
4236-
.. code-block:: c++
4237-
4238-
void foo() {
4239-
[[intel::nofusion]] for (int i=0; i<10;++i) { }
4240-
}
4241-
4242-
void nofusion() {
4243-
int a1[10];
4244-
for (int i = 0; i < 10; ++i) {
4245-
[[intel::nofusion]] for (int j = 0; j < 10; ++j) {
4246-
a1[i] += a1[j];
4247-
}
4248-
}
4249-
4250-
}];
4251-
}
4252-
42534229
def SYCLIntelMaxReinvocationDelayAttrDocs : Documentation {
42544230
let Category = DocCatVariable;
42554231
let Heading = "intel::max_reinvocation_delay";
@@ -4312,34 +4288,6 @@ used on the same loop in conjunction with ``disable_loop_pipelining`` attribute.
43124288
}];
43134289
}
43144290

4315-
def SYCLIntelLoopFuseDocs : Documentation {
4316-
let Category = DocCatFunction;
4317-
let Heading = "loop_fuse, loop_fuse_independent";
4318-
let Content = [{
4319-
``[[intel::loop_fuse(N)]]`` and ``[[intel::loop_fuse_independent(N)]]`` attributes apply
4320-
to a function/lambda function. It is a strong request, to the extent possible, to fuse
4321-
the loops within the function, that are contained in at most N-1 other loops within the
4322-
function. If the optional parameter N is omitted, it is a strong request, to the extent
4323-
possible, to fuse loops within the function that are not contained in any other loop
4324-
within the function. ``[[intel::loop_fuse_independent(N)]]`` also guarantees that fusion
4325-
safety analysis can ignore negative-distance dependences between these loops.
4326-
4327-
.. code-block:: c++
4328-
4329-
[[intel::loop_fuse(N)]]
4330-
int foo() {}
4331-
4332-
[[intel::loop_fuse_independent(N)]]
4333-
int foo() {}
4334-
4335-
4336-
``[[intel::loop_fuse(N)]]`` and ``[[intel::loop_fuse_independent(N)]]`` takes one optional
4337-
parameter that is a constant unsigned integer expression. The parameter N may be a template
4338-
parameter.
4339-
4340-
}];
4341-
}
4342-
43434291
def SYCLAddIRAttributesFunctionDocs : Documentation {
43444292
let Category = DocCatFunction;
43454293
let Heading = "add_ir_attributes_function";

clang/include/clang/Sema/SemaSYCL.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ class SemaSYCL : public SemaBase {
492492
void handleSYCLIntelMaxGlobalWorkDimAttr(Decl *D, const ParsedAttr &AL);
493493
void handleSYCLIntelNoGlobalWorkOffsetAttr(Decl *D, const ParsedAttr &AL);
494494
void handleSYCLIntelUseStallEnableClustersAttr(Decl *D, const ParsedAttr &AL);
495-
void handleSYCLIntelLoopFuseAttr(Decl *D, const ParsedAttr &AL);
496495
void handleSYCLIntelInitiationIntervalAttr(Decl *D, const ParsedAttr &AL);
497496
void handleSYCLIntelDoublePumpAttr(Decl *D, const ParsedAttr &AL);
498497
void handleSYCLIntelSinglePumpAttr(Decl *D, const ParsedAttr &AL);
@@ -542,8 +541,6 @@ class SemaSYCL : public SemaBase {
542541
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr *
543542
mergeSYCLIntelMaxWorkGroupsPerMultiprocessorAttr(
544543
Decl *D, const SYCLIntelMaxWorkGroupsPerMultiprocessorAttr &A);
545-
SYCLIntelLoopFuseAttr *
546-
mergeSYCLIntelLoopFuseAttr(Decl *D, const SYCLIntelLoopFuseAttr &A);
547544
SYCLIntelESimdVectorizeAttr *
548545
mergeSYCLIntelESimdVectorizeAttr(Decl *D,
549546
const SYCLIntelESimdVectorizeAttr &A);
@@ -641,8 +638,6 @@ class SemaSYCL : public SemaBase {
641638
Expr **Exprs, unsigned Size);
642639
void addSYCLUsesAspectsAttr(Decl *D, const AttributeCommonInfo &CI,
643640
Expr **Exprs, unsigned Size);
644-
void addSYCLIntelLoopFuseAttr(Decl *D, const AttributeCommonInfo &CI,
645-
Expr *E);
646641
void addSYCLIntelNumSimdWorkItemsAttr(Decl *D, const AttributeCommonInfo &CI,
647642
Expr *E);
648643
void addSYCLIntelSchedulerTargetFmaxMhzAttr(Decl *D,

clang/lib/CodeGen/CGLoopInfo.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,6 @@ SmallVector<Metadata *, 4> LoopInfo::createMetadata(
579579
LoopProperties.push_back(MDNode::get(Ctx, Vals));
580580
}
581581

582-
// nofusion attribute corresponds to 'llvm.loop.fusion.disable' metadata
583-
if (Attrs.SYCLNofusionEnable) {
584-
Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.fusion.disable")};
585-
LoopProperties.push_back(MDNode::get(Ctx, Vals));
586-
}
587-
588582
if (Attrs.SYCLSpeculatedIterationsNIterations) {
589583
Metadata *Vals[] = {
590584
MDString::get(Ctx, "llvm.loop.intel.speculated.iterations.count"),
@@ -641,7 +635,7 @@ LoopAttributes::LoopAttributes(bool IsParallel)
641635
SYCLLoopCoalesceNLevels(0), SYCLLoopPipeliningDisable(false),
642636
SYCLLoopPipeliningEnable(false), UnrollCount(0), UnrollAndJamCount(0),
643637
DistributeEnable(LoopAttributes::Unspecified), PipelineDisabled(false),
644-
PipelineInitiationInterval(0), SYCLNofusionEnable(false), CodeAlign(0),
638+
PipelineInitiationInterval(0), CodeAlign(0),
645639
MustProgress(false) {}
646640

647641
void LoopAttributes::clear() {
@@ -670,7 +664,6 @@ void LoopAttributes::clear() {
670664
DistributeEnable = LoopAttributes::Unspecified;
671665
PipelineDisabled = false;
672666
PipelineInitiationInterval = 0;
673-
SYCLNofusionEnable = false;
674667
CodeAlign = 0;
675668
MustProgress = false;
676669
}
@@ -706,7 +699,7 @@ LoopInfo::LoopInfo(BasicBlock *Header, const LoopAttributes &Attrs,
706699
Attrs.UnrollEnable == LoopAttributes::Unspecified &&
707700
Attrs.UnrollAndJamEnable == LoopAttributes::Unspecified &&
708701
Attrs.DistributeEnable == LoopAttributes::Unspecified &&
709-
Attrs.CodeAlign == 0 && !StartLoc && Attrs.SYCLNofusionEnable == false &&
702+
Attrs.CodeAlign == 0 && !StartLoc &&
710703
!EndLoc && !Attrs.MustProgress)
711704
return;
712705

@@ -1103,9 +1096,6 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx,
11031096
setSYCLSpeculatedIterationsNIterations(ArgVal.getSExtValue());
11041097
}
11051098

1106-
if (isa<SYCLIntelNofusionAttr>(A))
1107-
setSYCLNofusionEnable();
1108-
11091099
if (const auto *SYCLIntelMaxReinvocationDelay =
11101100
dyn_cast<SYCLIntelMaxReinvocationDelayAttr>(A)) {
11111101
const auto *CE = cast<ConstantExpr>(

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,18 +1258,6 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
12581258
}
12591259

12601260
if (getLangOpts().SYCLIsDevice && D) {
1261-
if (const auto *A = D->getAttr<SYCLIntelLoopFuseAttr>()) {
1262-
const auto *CE = cast<ConstantExpr>(A->getValue());
1263-
std::optional<llvm::APSInt> ArgVal = CE->getResultAsAPSInt();
1264-
llvm::Metadata *AttrMDArgs[] = {
1265-
llvm::ConstantAsMetadata::get(
1266-
Builder.getInt32(ArgVal->getZExtValue())),
1267-
llvm::ConstantAsMetadata::get(
1268-
A->isIndependent() ? Builder.getInt32(1) : Builder.getInt32(0))};
1269-
Fn->setMetadata("loop_fuse",
1270-
llvm::MDNode::get(getLLVMContext(), AttrMDArgs));
1271-
}
1272-
12731261
// Source location of functions is required to emit required diagnostics in
12741262
// SYCLPropagateAspectsUsagePass. Save the token in a srcloc metadata node.
12751263
llvm::ConstantInt *Line =

clang/lib/Sema/SemaDecl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,8 +2957,6 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
29572957
NewAttr = S.Wasm().mergeImportModuleAttr(D, *IMA);
29582958
else if (const auto *INA = dyn_cast<WebAssemblyImportNameAttr>(Attr))
29592959
NewAttr = S.Wasm().mergeImportNameAttr(D, *INA);
2960-
else if (const auto *A = dyn_cast<SYCLIntelLoopFuseAttr>(Attr))
2961-
NewAttr = S.SYCL().mergeSYCLIntelLoopFuseAttr(D, *A);
29622960
else if (const auto *TCBA = dyn_cast<EnforceTCBAttr>(Attr))
29632961
NewAttr = S.mergeEnforceTCBAttr(D, *TCBA);
29642962
else if (const auto *TCBLA = dyn_cast<EnforceTCBLeafAttr>(Attr))

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7860,9 +7860,6 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
78607860
case ParsedAttr::AT_SYCLIntelUseStallEnableClusters:
78617861
S.SYCL().handleSYCLIntelUseStallEnableClustersAttr(D, AL);
78627862
break;
7863-
case ParsedAttr::AT_SYCLIntelLoopFuse:
7864-
S.SYCL().handleSYCLIntelLoopFuseAttr(D, AL);
7865-
break;
78667863
case ParsedAttr::AT_SYCLIntelInitiationInterval:
78677864
S.SYCL().handleSYCLIntelInitiationIntervalAttr(D, AL);
78687865
break;

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ static void collectSYCLAttributes(FunctionDecl *FD,
667667
SYCLIntelMinWorkGroupsPerComputeUnitAttr,
668668
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr,
669669
SYCLIntelNoGlobalWorkOffsetAttr, SYCLSimdAttr,
670-
SYCLIntelLoopFuseAttr, SYCLIntelMaxConcurrencyAttr,
670+
SYCLIntelMaxConcurrencyAttr,
671671
SYCLIntelDisableLoopPipeliningAttr,
672672
SYCLIntelInitiationIntervalAttr,
673673
SYCLIntelUseStallEnableClustersAttr, SYCLDeviceHasAttr,
@@ -5804,7 +5804,6 @@ static void PropagateAndDiagnoseDeviceAttr(SemaSYCL &S, Attr *A,
58045804
case attr::Kind::SYCLIntelMinWorkGroupsPerComputeUnit:
58055805
case attr::Kind::SYCLIntelMaxWorkGroupsPerMultiprocessor:
58065806
case attr::Kind::SYCLIntelNoGlobalWorkOffset:
5807-
case attr::Kind::SYCLIntelLoopFuse:
58085807
case attr::Kind::SYCLIntelMaxConcurrency:
58095808
case attr::Kind::SYCLIntelDisableLoopPipelining:
58105809
case attr::Kind::SYCLIntelInitiationInterval:

clang/lib/Sema/SemaSYCLDeclAttr.cpp

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -753,57 +753,6 @@ void SemaSYCL::addSYCLIntelPipeIOAttr(Decl *D, const AttributeCommonInfo &CI,
753753
D->addAttr(::new (Context) SYCLIntelPipeIOAttr(Context, CI, E));
754754
}
755755

756-
// Handles [[intel::loop_fuse]] and [[intel::loop_fuse_independent]].
757-
void SemaSYCL::addSYCLIntelLoopFuseAttr(Decl *D, const AttributeCommonInfo &CI,
758-
Expr *E) {
759-
if (!E->isValueDependent()) {
760-
// Validate that we have an integer constant expression and then store the
761-
// converted constant expression into the semantic attribute so that we
762-
// don't have to evaluate it again later.
763-
llvm::APSInt ArgVal;
764-
ExprResult Res = SemaRef.VerifyIntegerConstantExpression(E, &ArgVal);
765-
if (Res.isInvalid())
766-
return;
767-
E = Res.get();
768-
769-
// This attribute requires a non-negative value.
770-
if (ArgVal < 0) {
771-
Diag(E->getExprLoc(), diag::err_attribute_requires_positive_integer)
772-
<< CI << /*non-negative*/ 1;
773-
return;
774-
}
775-
// Check to see if there's a duplicate attribute with different values
776-
// already applied to the declaration.
777-
if (const auto *DeclAttr = D->getAttr<SYCLIntelLoopFuseAttr>()) {
778-
// [[intel::loop_fuse]] and [[intel::loop_fuse_independent]] are
779-
// incompatible.
780-
// FIXME: If additional spellings are provided for this attribute,
781-
// this code will do the wrong thing.
782-
if (DeclAttr->getAttributeSpellingListIndex() !=
783-
CI.getAttributeSpellingListIndex()) {
784-
Diag(CI.getLoc(), diag::err_attributes_are_not_compatible)
785-
<< CI << DeclAttr << CI.isRegularKeywordAttribute();
786-
Diag(DeclAttr->getLocation(), diag::note_conflicting_attribute);
787-
return;
788-
}
789-
// If the other attribute argument is instantiation dependent, we won't
790-
// have converted it to a constant expression yet and thus we test
791-
// whether this is a null pointer.
792-
if (const auto *DeclExpr = dyn_cast<ConstantExpr>(DeclAttr->getValue())) {
793-
if (ArgVal != DeclExpr->getResultAsAPSInt()) {
794-
Diag(CI.getLoc(), diag::warn_duplicate_attribute) << CI;
795-
Diag(DeclAttr->getLoc(), diag::note_previous_attribute);
796-
}
797-
// Drop the duplicate attribute.
798-
return;
799-
}
800-
}
801-
}
802-
803-
ASTContext &Context = getASTContext();
804-
D->addAttr(::new (Context) SYCLIntelLoopFuseAttr(Context, CI, E));
805-
}
806-
807756
void SemaSYCL::addIntelReqdSubGroupSizeAttr(Decl *D,
808757
const AttributeCommonInfo &CI,
809758
Expr *E) {
@@ -2353,48 +2302,6 @@ SemaSYCL::mergeSYCLIntelMaxWorkGroupsPerMultiprocessorAttr(
23532302
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr(Context, A, A.getValue());
23542303
}
23552304

2356-
void SemaSYCL::handleSYCLIntelLoopFuseAttr(Decl *D, const ParsedAttr &A) {
2357-
// If no attribute argument is specified, set to default value '1'.
2358-
ASTContext &Context = getASTContext();
2359-
Expr *E = A.isArgExpr(0) ? A.getArgAsExpr(0)
2360-
: IntegerLiteral::Create(Context, llvm::APInt(32, 1),
2361-
Context.IntTy, A.getLoc());
2362-
2363-
addSYCLIntelLoopFuseAttr(D, A, E);
2364-
}
2365-
2366-
SYCLIntelLoopFuseAttr *
2367-
SemaSYCL::mergeSYCLIntelLoopFuseAttr(Decl *D, const SYCLIntelLoopFuseAttr &A) {
2368-
// Check to see if there's a duplicate attribute with different values
2369-
// already applied to the declaration.
2370-
if (const auto *DeclAttr = D->getAttr<SYCLIntelLoopFuseAttr>()) {
2371-
// [[intel::loop_fuse]] and [[intel::loop_fuse_independent]] are
2372-
// incompatible.
2373-
// FIXME: If additional spellings are provided for this attribute,
2374-
// this code will do the wrong thing.
2375-
if (DeclAttr->getAttributeSpellingListIndex() !=
2376-
A.getAttributeSpellingListIndex()) {
2377-
Diag(A.getLoc(), diag::err_attributes_are_not_compatible)
2378-
<< &A << DeclAttr << A.isRegularKeywordAttribute();
2379-
Diag(DeclAttr->getLoc(), diag::note_conflicting_attribute);
2380-
return nullptr;
2381-
}
2382-
if (const auto *DeclExpr = dyn_cast<ConstantExpr>(DeclAttr->getValue())) {
2383-
if (const auto *MergeExpr = dyn_cast<ConstantExpr>(A.getValue())) {
2384-
if (DeclExpr->getResultAsAPSInt() != MergeExpr->getResultAsAPSInt()) {
2385-
Diag(DeclAttr->getLoc(), diag::warn_duplicate_attribute) << &A;
2386-
Diag(A.getLoc(), diag::note_previous_attribute);
2387-
}
2388-
// Do not add a duplicate attribute.
2389-
return nullptr;
2390-
}
2391-
}
2392-
}
2393-
2394-
ASTContext &Context = getASTContext();
2395-
return ::new (Context) SYCLIntelLoopFuseAttr(Context, A, A.getValue());
2396-
}
2397-
23982305
void SemaSYCL::handleSYCLIntelESimdVectorizeAttr(Decl *D, const ParsedAttr &A) {
23992306
checkDeprecatedSYCLAttributeSpelling(A);
24002307

clang/lib/Sema/SemaStmtAttr.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,6 @@ static Attr *handleIntelIVDepAttr(Sema &S, Stmt *St, const ParsedAttr &A) {
389389
NumArgs == 2 ? A.getArgAsExpr(1) : nullptr);
390390
}
391391

392-
static Attr *handleIntelNofusionAttr(Sema &S, Stmt *St,
393-
const ParsedAttr &A) {
394-
return new (S.Context) SYCLIntelNofusionAttr(S.Context, A);
395-
}
396-
397392
SYCLIntelMaxReinvocationDelayAttr *
398393
Sema::BuildSYCLIntelMaxReinvocationDelayAttr(const AttributeCommonInfo &CI,
399394
Expr *E) {
@@ -993,7 +988,6 @@ static void CheckForIncompatibleSYCLLoopAttributes(
993988
CheckForDuplicateAttrs<SYCLIntelSpeculatedIterationsAttr>(S, Attrs);
994989
CheckForDuplicationSYCLLoopAttribute<LoopUnrollHintAttr>(S, Attrs, false);
995990
CheckRedundantSYCLIntelIVDepAttrs(S, Attrs);
996-
CheckForDuplicationSYCLLoopAttribute<SYCLIntelNofusionAttr>(S, Attrs);
997991
CheckForDuplicateAttrs<SYCLIntelMaxReinvocationDelayAttr>(S, Attrs);
998992
CheckForDuplicationSYCLLoopAttribute<SYCLIntelEnableLoopPipeliningAttr>(
999993
S, Attrs);
@@ -1213,8 +1207,6 @@ static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &A,
12131207
return handleLikely(S, St, A, Range);
12141208
case ParsedAttr::AT_Unlikely:
12151209
return handleUnlikely(S, St, A, Range);
1216-
case ParsedAttr::AT_SYCLIntelNofusion:
1217-
return handleIntelNofusionAttr(S, St, A);
12181210
case ParsedAttr::AT_SYCLIntelMaxReinvocationDelay:
12191211
return handleSYCLIntelMaxReinvocationDelayAttr(S, St, A);
12201212
case ParsedAttr::AT_SYCLIntelEnableLoopPipelining:

0 commit comments

Comments
 (0)