Skip to content

Commit 0d12683

Browse files
committed
1 parent e7ab698 commit 0d12683

File tree

22 files changed

+105
-489
lines changed

22 files changed

+105
-489
lines changed

clang/include/clang/AST/OpenMPClause.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9172,54 +9172,6 @@ class OMPDoacrossClause final
91729172
}
91739173
};
91749174

9175-
/// This represents 'ompx_attribute' clause in a directive that might generate
9176-
/// an outlined function. An example is given below.
9177-
///
9178-
/// \code
9179-
/// #pragma omp target [...] ompx_attribute(flatten)
9180-
/// \endcode
9181-
class OMPXAttributeClause
9182-
: public OMPNoChildClause<llvm::omp::OMPC_ompx_attribute> {
9183-
friend class OMPClauseReader;
9184-
9185-
/// Location of '('.
9186-
SourceLocation LParenLoc;
9187-
9188-
/// The parsed attributes (clause arguments)
9189-
SmallVector<const Attr *> Attrs;
9190-
9191-
public:
9192-
/// Build 'ompx_attribute' clause.
9193-
///
9194-
/// \param Attrs The parsed attributes (clause arguments)
9195-
/// \param StartLoc Starting location of the clause.
9196-
/// \param LParenLoc Location of '('.
9197-
/// \param EndLoc Ending location of the clause.
9198-
OMPXAttributeClause(ArrayRef<const Attr *> Attrs, SourceLocation StartLoc,
9199-
SourceLocation LParenLoc, SourceLocation EndLoc)
9200-
: OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) {
9201-
}
9202-
9203-
/// Build an empty clause.
9204-
OMPXAttributeClause() : OMPNoChildClause() {}
9205-
9206-
/// Sets the location of '('.
9207-
void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
9208-
9209-
/// Returns the location of '('.
9210-
SourceLocation getLParenLoc() const { return LParenLoc; }
9211-
9212-
/// Returned the attributes parsed from this clause.
9213-
ArrayRef<const Attr *> getAttrs() const { return Attrs; }
9214-
9215-
private:
9216-
/// Replace the attributes with \p NewAttrs.
9217-
void setAttrs(ArrayRef<Attr *> NewAttrs) {
9218-
Attrs.clear();
9219-
Attrs.append(NewAttrs.begin(), NewAttrs.end());
9220-
}
9221-
};
9222-
92239175
} // namespace clang
92249176

92259177
#endif // LLVM_CLANG_AST_OPENMPCLAUSE_H

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3875,12 +3875,6 @@ bool RecursiveASTVisitor<Derived>::VisitOMPDoacrossClause(
38753875
return true;
38763876
}
38773877

3878-
template <typename Derived>
3879-
bool RecursiveASTVisitor<Derived>::VisitOMPXAttributeClause(
3880-
OMPXAttributeClause *C) {
3881-
return true;
3882-
}
3883-
38843878
// FIXME: look at the following tricky-seeming exprs to see if we
38853879
// need to recurse on anything. These are ones that have methods
38863880
// returning decls or qualtypes or nestednamespecifier -- though I'm

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,10 +1278,9 @@ def OpenMPMapping : DiagGroup<"openmp-mapping">;
12781278
def OpenMPTarget : DiagGroup<"openmp-target", [OpenMPMapping]>;
12791279
def OpenMPPre51Compat : DiagGroup<"pre-openmp-51-compat">;
12801280
def OpenMP51Ext : DiagGroup<"openmp-51-extensions">;
1281-
def OpenMPExtensions : DiagGroup<"openmp-extensions">;
12821281
def OpenMP : DiagGroup<"openmp", [
12831282
SourceUsesOpenMP, OpenMPClauses, OpenMPLoopForm, OpenMPTarget,
1284-
OpenMPMapping, OpenMP51Ext, OpenMPExtensions
1283+
OpenMPMapping, OpenMP51Ext
12851284
]>;
12861285

12871286
// Backend warnings.

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,9 +1540,6 @@ def warn_omp_more_one_omp_all_memory : Warning<
15401540
InGroup<OpenMPClauses>;
15411541
def warn_omp_depend_in_ordered_deprecated : Warning<"'depend' clause for"
15421542
" 'ordered' is deprecated; use 'doacross' instead">, InGroup<Deprecated>;
1543-
def warn_omp_invalid_attribute_for_ompx_attributes : Warning<"'ompx_attribute' clause only allows "
1544-
"'amdgpu_flat_work_group_size', 'amdgpu_waves_per_eu', and 'launch_bounds'; "
1545-
"%0 is ignored">, InGroup<OpenMPExtensions>;
15461543

15471544
// Pragma loop support.
15481545
def err_pragma_loop_missing_argument : Error<

clang/include/clang/Parse/Parser.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,13 +3490,6 @@ class Parser : public CodeCompletionHandler {
34903490
//
34913491
OMPClause *ParseOpenMPInteropClause(OpenMPClauseKind Kind, bool ParseOnly);
34923492

3493-
/// Parses a ompx_attribute clause
3494-
///
3495-
/// \param ParseOnly true to skip the clause's semantic actions and return
3496-
/// nullptr.
3497-
//
3498-
OMPClause *ParseOpenMPOMPXAttributesClause(bool ParseOnly);
3499-
35003493
public:
35013494
/// Parses simple expression in parens for single-expression clauses of OpenMP
35023495
/// constructs.

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10988,11 +10988,6 @@ class Sema final {
1098810988
bool ConstantFoldAttrArgs(const AttributeCommonInfo &CI,
1098910989
MutableArrayRef<Expr *> Args);
1099010990

10991-
/// Create an CUDALaunchBoundsAttr attribute.
10992-
CUDALaunchBoundsAttr *CreateLaunchBoundsAttr(const AttributeCommonInfo &CI,
10993-
Expr *MaxThreads,
10994-
Expr *MinBlocks);
10995-
1099610991
/// AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular
1099710992
/// declaration.
1099810993
void AddLaunchBoundsAttr(Decl *D, const AttributeCommonInfo &CI,
@@ -11009,21 +11004,11 @@ class Sema final {
1100911004
void AddXConsumedAttr(Decl *D, const AttributeCommonInfo &CI,
1101011005
RetainOwnershipKind K, bool IsTemplateInstantiation);
1101111006

11012-
/// Create an AMDGPUWavesPerEUAttr attribute.
11013-
AMDGPUFlatWorkGroupSizeAttr *
11014-
CreateAMDGPUFlatWorkGroupSizeAttr(const AttributeCommonInfo &CI, Expr *Min,
11015-
Expr *Max);
11016-
1101711007
/// addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size
1101811008
/// attribute to a particular declaration.
1101911009
void addAMDGPUFlatWorkGroupSizeAttr(Decl *D, const AttributeCommonInfo &CI,
1102011010
Expr *Min, Expr *Max);
1102111011

11022-
/// Create an AMDGPUWavesPerEUAttr attribute.
11023-
AMDGPUWavesPerEUAttr *
11024-
CreateAMDGPUWavesPerEUAttr(const AttributeCommonInfo &CI, Expr *Min,
11025-
Expr *Max);
11026-
1102711012
/// addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a
1102811013
/// particular declaration.
1102911014
void addAMDGPUWavesPerEUAttr(Decl *D, const AttributeCommonInfo &CI,
@@ -12356,12 +12341,6 @@ class Sema final {
1235612341
ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1235712342
SourceLocation LParenLoc, SourceLocation EndLoc);
1235812343

12359-
/// Called on a well-formed 'ompx_attribute' clause.
12360-
OMPClause *ActOnOpenMPXAttributeClause(ArrayRef<const Attr *> Attrs,
12361-
SourceLocation StartLoc,
12362-
SourceLocation LParenLoc,
12363-
SourceLocation EndLoc);
12364-
1236512344
/// The kind of conversion being performed.
1236612345
enum CheckedConversionKind {
1236712346
/// An implicit conversion.

clang/lib/AST/OpenMPClause.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,18 +2534,6 @@ void OMPClausePrinter::VisitOMPDoacrossClause(OMPDoacrossClause *Node) {
25342534
OS << ")";
25352535
}
25362536

2537-
void OMPClausePrinter::VisitOMPXAttributeClause(OMPXAttributeClause *Node) {
2538-
OS << "ompx_attribute(";
2539-
bool IsFirst = true;
2540-
for (auto &Attr : Node->getAttrs()) {
2541-
if (!IsFirst)
2542-
OS << ", ";
2543-
Attr->printPretty(OS, Policy);
2544-
IsFirst = false;
2545-
}
2546-
OS << ")";
2547-
}
2548-
25492537
void OMPTraitInfo::getAsVariantMatchInfo(ASTContext &ASTCtx,
25502538
VariantMatchInfo &VMI) const {
25512539
for (const OMPTraitSet &Set : Sets) {

clang/lib/AST/StmtProfile.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,6 @@ void OMPClauseProfiler::VisitOMPXDynCGroupMemClause(
928928
void OMPClauseProfiler::VisitOMPDoacrossClause(const OMPDoacrossClause *C) {
929929
VisitOMPClauseList(C);
930930
}
931-
void OMPClauseProfiler::VisitOMPXAttributeClause(const OMPXAttributeClause *C) {
932-
}
933931
} // namespace
934932

935933
void

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6110,23 +6110,8 @@ void CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(
61106110
DefaultValTeams, DefaultValThreads,
61116111
IsOffloadEntry, OutlinedFn, OutlinedFnID);
61126112

6113-
if (!OutlinedFn)
6114-
return;
6115-
6116-
CGM.getTargetCodeGenInfo().setTargetAttributes(nullptr, OutlinedFn, CGM);
6117-
6118-
for (auto *C : D.getClausesOfKind<OMPXAttributeClause>()) {
6119-
for (auto *A : C->getAttrs()) {
6120-
if (auto *Attr = dyn_cast<CUDALaunchBoundsAttr>(A))
6121-
CGM.handleCUDALaunchBoundsAttr(OutlinedFn, Attr);
6122-
else if (auto *Attr = dyn_cast<AMDGPUFlatWorkGroupSizeAttr>(A))
6123-
CGM.handleAMDGPUFlatWorkGroupSizeAttr(OutlinedFn, Attr);
6124-
else if (auto *Attr = dyn_cast<AMDGPUWavesPerEUAttr>(A))
6125-
CGM.handleAMDGPUWavesPerEUAttr(OutlinedFn, Attr);
6126-
else
6127-
llvm_unreachable("Unexpected attribute kind");
6128-
}
6129-
}
6113+
if (OutlinedFn != nullptr)
6114+
CGM.getTargetCodeGenInfo().setTargetAttributes(nullptr, OutlinedFn, CGM);
61306115
}
61316116

61326117
/// Checks if the expression is constant or does not have non-trivial function

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,21 +1557,6 @@ class CodeGenModule : public CodeGenTypeCache {
15571557
/// because we'll lose all important information after each repl.
15581558
void moveLazyEmissionStates(CodeGenModule *NewBuilder);
15591559

1560-
/// Emit the IR encoding to attach the CUDA launch bounds attribute to \p F.
1561-
void handleCUDALaunchBoundsAttr(llvm::Function *F,
1562-
const CUDALaunchBoundsAttr *A);
1563-
1564-
/// Emit the IR encoding to attach the AMD GPU flat-work-group-size attribute
1565-
/// to \p F. Alternatively, the work group size can be taken from a \p
1566-
/// ReqdWGS.
1567-
void handleAMDGPUFlatWorkGroupSizeAttr(
1568-
llvm::Function *F, const AMDGPUFlatWorkGroupSizeAttr *A,
1569-
const ReqdWorkGroupSizeAttr *ReqdWGS = nullptr);
1570-
1571-
/// Emit the IR encoding to attach the AMD GPU waves-per-eu attribute to \p F.
1572-
void handleAMDGPUWavesPerEUAttr(llvm::Function *F,
1573-
const AMDGPUWavesPerEUAttr *A);
1574-
15751560
private:
15761561
llvm::Constant *GetOrCreateLLVMFunction(
15771562
StringRef MangledName, llvm::Type *Ty, GlobalDecl D, bool ForVTable,

0 commit comments

Comments
 (0)