Skip to content

Commit 6f1c905

Browse files
AaronBallmanarichardson
authored andcommitted
2 parents 1b620a2 + 0d12683 commit 6f1c905

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
@@ -3884,12 +3884,6 @@ bool RecursiveASTVisitor<Derived>::VisitOMPDoacrossClause(
38843884
return true;
38853885
}
38863886

3887-
template <typename Derived>
3888-
bool RecursiveASTVisitor<Derived>::VisitOMPXAttributeClause(
3889-
OMPXAttributeClause *C) {
3890-
return true;
3891-
}
3892-
38933887
// FIXME: look at the following tricky-seeming exprs to see if we
38943888
// need to recurse on anything. These are ones that have methods
38953889
// 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
@@ -1308,10 +1308,9 @@ def OpenMPMapping : DiagGroup<"openmp-mapping">;
13081308
def OpenMPTarget : DiagGroup<"openmp-target", [OpenMPMapping]>;
13091309
def OpenMPPre51Compat : DiagGroup<"pre-openmp-51-compat">;
13101310
def OpenMP51Ext : DiagGroup<"openmp-51-extensions">;
1311-
def OpenMPExtensions : DiagGroup<"openmp-extensions">;
13121311
def OpenMP : DiagGroup<"openmp", [
13131312
SourceUsesOpenMP, OpenMPClauses, OpenMPLoopForm, OpenMPTarget,
1314-
OpenMPMapping, OpenMP51Ext, OpenMPExtensions
1313+
OpenMPMapping, OpenMP51Ext
13151314
]>;
13161315

13171316
// Backend warnings.

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,9 +1549,6 @@ def warn_omp_more_one_omp_all_memory : Warning<
15491549
InGroup<OpenMPClauses>;
15501550
def warn_omp_depend_in_ordered_deprecated : Warning<"'depend' clause for"
15511551
" 'ordered' is deprecated; use 'doacross' instead">, InGroup<Deprecated>;
1552-
def warn_omp_invalid_attribute_for_ompx_attributes : Warning<"'ompx_attribute' clause only allows "
1553-
"'amdgpu_flat_work_group_size', 'amdgpu_waves_per_eu', and 'launch_bounds'; "
1554-
"%0 is ignored">, InGroup<OpenMPExtensions>;
15551552

15561553
// Pragma loop support.
15571554
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
@@ -3493,13 +3493,6 @@ class Parser : public CodeCompletionHandler {
34933493
//
34943494
OMPClause *ParseOpenMPInteropClause(OpenMPClauseKind Kind, bool ParseOnly);
34953495

3496-
/// Parses a ompx_attribute clause
3497-
///
3498-
/// \param ParseOnly true to skip the clause's semantic actions and return
3499-
/// nullptr.
3500-
//
3501-
OMPClause *ParseOpenMPOMPXAttributesClause(bool ParseOnly);
3502-
35033496
public:
35043497
/// Parses simple expression in parens for single-expression clauses of OpenMP
35053498
/// constructs.

clang/include/clang/Sema/Sema.h

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

11037-
/// Create an CUDALaunchBoundsAttr attribute.
11038-
CUDALaunchBoundsAttr *CreateLaunchBoundsAttr(const AttributeCommonInfo &CI,
11039-
Expr *MaxThreads,
11040-
Expr *MinBlocks);
11041-
1104211037
/// AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular
1104311038
/// declaration.
1104411039
void AddLaunchBoundsAttr(Decl *D, const AttributeCommonInfo &CI,
@@ -11055,21 +11050,11 @@ class Sema final {
1105511050
void AddXConsumedAttr(Decl *D, const AttributeCommonInfo &CI,
1105611051
RetainOwnershipKind K, bool IsTemplateInstantiation);
1105711052

11058-
/// Create an AMDGPUWavesPerEUAttr attribute.
11059-
AMDGPUFlatWorkGroupSizeAttr *
11060-
CreateAMDGPUFlatWorkGroupSizeAttr(const AttributeCommonInfo &CI, Expr *Min,
11061-
Expr *Max);
11062-
1106311053
/// addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size
1106411054
/// attribute to a particular declaration.
1106511055
void addAMDGPUFlatWorkGroupSizeAttr(Decl *D, const AttributeCommonInfo &CI,
1106611056
Expr *Min, Expr *Max);
1106711057

11068-
/// Create an AMDGPUWavesPerEUAttr attribute.
11069-
AMDGPUWavesPerEUAttr *
11070-
CreateAMDGPUWavesPerEUAttr(const AttributeCommonInfo &CI, Expr *Min,
11071-
Expr *Max);
11072-
1107311058
/// addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a
1107411059
/// particular declaration.
1107511060
void addAMDGPUWavesPerEUAttr(Decl *D, const AttributeCommonInfo &CI,
@@ -12402,12 +12387,6 @@ class Sema final {
1240212387
ArrayRef<Expr *> VarList, SourceLocation StartLoc,
1240312388
SourceLocation LParenLoc, SourceLocation EndLoc);
1240412389

12405-
/// Called on a well-formed 'ompx_attribute' clause.
12406-
OMPClause *ActOnOpenMPXAttributeClause(ArrayRef<const Attr *> Attrs,
12407-
SourceLocation StartLoc,
12408-
SourceLocation LParenLoc,
12409-
SourceLocation EndLoc);
12410-
1241112390
/// The kind of conversion being performed.
1241212391
enum CheckedConversionKind {
1241312392
/// 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
@@ -6115,23 +6115,8 @@ void CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(
61156115
DefaultValTeams, DefaultValThreads,
61166116
IsOffloadEntry, OutlinedFn, OutlinedFnID);
61176117

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

61376122
/// 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
@@ -1588,21 +1588,6 @@ class CodeGenModule : public CodeGenTypeCache {
15881588
/// because we'll lose all important information after each repl.
15891589
void moveLazyEmissionStates(CodeGenModule *NewBuilder);
15901590

1591-
/// Emit the IR encoding to attach the CUDA launch bounds attribute to \p F.
1592-
void handleCUDALaunchBoundsAttr(llvm::Function *F,
1593-
const CUDALaunchBoundsAttr *A);
1594-
1595-
/// Emit the IR encoding to attach the AMD GPU flat-work-group-size attribute
1596-
/// to \p F. Alternatively, the work group size can be taken from a \p
1597-
/// ReqdWGS.
1598-
void handleAMDGPUFlatWorkGroupSizeAttr(
1599-
llvm::Function *F, const AMDGPUFlatWorkGroupSizeAttr *A,
1600-
const ReqdWorkGroupSizeAttr *ReqdWGS = nullptr);
1601-
1602-
/// Emit the IR encoding to attach the AMD GPU waves-per-eu attribute to \p F.
1603-
void handleAMDGPUWavesPerEUAttr(llvm::Function *F,
1604-
const AMDGPUWavesPerEUAttr *A);
1605-
16061591
private:
16071592
llvm::Constant *GetOrCreateLLVMFunction(
16081593
StringRef MangledName, llvm::Type *Ty, GlobalDecl D, bool ForVTable,

0 commit comments

Comments
 (0)