[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -132,6 +132,12 @@ Attribute Changes in Clang This forces the global to be considered small or large in regards to the x86-64 code model, regardless of the code model specified for the compilation. +- Introduced a new statement attribute ``[[clang::atomic]]`` that enabl

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -3286,6 +3286,8 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def err_attribute_inval

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -1107,6 +1113,66 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal_

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -132,6 +132,12 @@ Attribute Changes in Clang This forces the global to be considered small or large in regards to the x86-64 code model, regardless of the code model specified for the compilation. +- Introduced a new statement attribute ``[[clang::atomic]]`` that enabl

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Hubert Tong via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -1107,6 +1113,66 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal_

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -3286,6 +3286,8 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def err_attribute_inval

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -625,6 +625,41 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &AL, + Sourc

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -4979,3 +4979,16 @@ def NoTrivialAutoVarInit: InheritableAttr { let Documentation = [NoTrivialAutoVarInitDocs]; let SimpleHandler = 1; } + +def Atomic : StmtAttr { + let Spellings = [Clang<"atomic">]; + let Args = [VariadicStringArgument<"Options">]; y

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -3101,6 +3101,11 @@ class Parser : public CodeCompletionHandler { std::optional ParseAvailabilitySpec(); ExprResult ParseAvailabilityCheckExpr(SourceLocation StartLoc); + void ParseAtomicAttribute(IdentifierInfo &AttrName, yxsamliu wrote: will use Var

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-22 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-21 Thread Erich Keane via cfe-commits
@@ -5400,6 +5400,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -313,6 +313,8 @@ EXTENSION(datasizeof, LangOpts.CPlusPlus) FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables) +FEATURE(atomic_attributes, true) yxsamliu wrote: will change https://github.com/llvm/llvm-project/pull/114

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -5400,6 +5400,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > ping As mentioned in the discourse, quite a few of us were out of contact thanks to the WG21 meeting that was last week. I'll take another look now. https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cf

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-06 Thread Yaxun Liu via cfe-commits
@@ -5404,6 +5404,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-06 Thread Erich Keane via cfe-commits
@@ -5404,6 +5404,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-05 Thread Yaxun Liu via cfe-commits
@@ -5404,6 +5404,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-05 Thread Erich Keane via cfe-commits
@@ -5404,6 +5404,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-05 Thread Erich Keane via cfe-commits
@@ -5404,6 +5404,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-05 Thread Yaxun Liu via cfe-commits
@@ -764,6 +764,73 @@ void Parser::ParseGNUAttributeArgs( ScopeLoc, Form); } +void Parser::ParseAtomicAttribute( yxsamliu wrote: I've simplified ParseAtomicAttribute by introducing a lambda that handles parsing a single option (inc

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-05 Thread Yaxun Liu via cfe-commits
@@ -5958,6 +5968,58 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs, JA); + if (Arg *AtomicArg = Args.getLastArg(options::OPT_fatomic_EQ)) { yxsamliu wrote: Refactored the cod

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-04 Thread Yaxun Liu via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-04 Thread Yaxun Liu via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-04 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-04 Thread Yaxun Liu via cfe-commits
@@ -5404,6 +5404,115 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -764,6 +764,73 @@ void Parser::ParseGNUAttributeArgs( ScopeLoc, Form); } +void Parser::ParseAtomicAttribute( erichkeane wrote: I'm very much beginning to dislike the syntax for this, if it needs this much special handling. We s

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -5958,6 +5968,58 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs, JA); + if (Arg *AtomicArg = Args.getLastArg(options::OPT_fatomic_EQ)) { erichkeane wrote: IMO, we need a s

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Erich Keane via cfe-commits
@@ -1096,6 +1100,177 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Aaron Ballman via cfe-commits
@@ -5404,6 +5404,115 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-02-03 Thread Aaron Ballman via cfe-commits
@@ -5404,6 +5404,115 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -623,6 +623,10 @@ class LangOptions : public LangOptionsBase { // WebAssembly target. bool NoWasmOpt = false; + /// The default atomic codegen options specified by command line in the + /// format of key:{on|off}. + std::vector AtomicOptionsAsWritten; ---

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -3292,6 +3292,8 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def err_attribute_inval

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -4972,3 +4972,59 @@ def NoTrivialAutoVarInit: InheritableAttr { let Documentation = [NoTrivialAutoVarInitDocs]; let SimpleHandler = 1; } + +def Atomic : StmtAttr { + let Spellings = [Clang<"atomic">]; + let Args = [ +EnumArgument<"NoRemoteMemory", "NoRemoteMemoryTy

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > The changes should definitely come with a release note in > `clang/docs/ReleaseNotes.rst`, but this also seems like it maybe should get > wider documentation in the language extensions manual. I mentioned a need for > attribute documentation, that could be simple docs which p

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Mostly drive-by comments. Don't have strong opinion on either the attributes > themselves nor how the values get parsed. > > One thing that's missing is the documentation for the attributes. Their > format and meaning are far from obvious and should be documented along with

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -240,3 +240,49 @@ LLVM_DUMP_METHOD void FPOptionsOverride::dump() { #include "clang/Basic/FPOptions.def" llvm::errs() << "\n"; } + +AtomicOptionsOverride +AtomicOptions::getChangesSlow(const AtomicOptions &Base) const { + AtomicOptions::storage_type OverrideMask = 0; +#de

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -2355,6 +2355,14 @@ def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group, Visibility<[ClangOption, CC1Option]>, MarshallingInfoString>; +def fatomic_EQ : CommaJoined<["-"], "fatomic=">, Group, + Visibility<[ClangOption, CC1Option]>, + HelpText<"Speci

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
@@ -623,6 +623,10 @@ class LangOptions : public LangOptionsBase { // WebAssembly target. bool NoWasmOpt = false; + /// The default atomic codegen options specified by command line in the + /// format of key:{on|off}. + std::vector AtomicOptionsAsWritten; ---

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes should definitely come with a release note in `clang/docs/ReleaseNotes.rst`, but this also seems like it maybe should get wider documentation in the language extensions manual. I mentioned a need for attribute documentation, that could be

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
@@ -4972,3 +4972,59 @@ def NoTrivialAutoVarInit: InheritableAttr { let Documentation = [NoTrivialAutoVarInitDocs]; let SimpleHandler = 1; } + +def Atomic : StmtAttr { + let Spellings = [Clang<"atomic">]; + let Args = [ +EnumArgument<"NoRemoteMemory", "NoRemoteMemoryTy

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
@@ -3292,6 +3292,8 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def err_attribute_inval

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
@@ -2355,6 +2355,14 @@ def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group, Visibility<[ClangOption, CC1Option]>, MarshallingInfoString>; +def fatomic_EQ : CommaJoined<["-"], "fatomic=">, Group, + Visibility<[ClangOption, CC1Option]>, + HelpText<"Speci

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
@@ -240,3 +240,49 @@ LLVM_DUMP_METHOD void FPOptionsOverride::dump() { #include "clang/Basic/FPOptions.def" llvm::errs() << "\n"; } + +AtomicOptionsOverride +AtomicOptions::getChangesSlow(const AtomicOptions &Base) const { + AtomicOptions::storage_type OverrideMask = 0; +#de

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B commented: Mostly drive-by comments. Don't have strong opinion on either the attributes themselves nor how the values get parsed. One thing that's missing is the documentation for the attributes. Their format and meaning are far from obvious and should be documented

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-29 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-28 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-07 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s \ +// RUN: -fatomic=no_fine_grained_memory:off,no_remote_memory:on,ignore_denormal_mode:on +

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-07 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s \ +// RUN: -fatomic=no_fine_grained_memory:off,no_remote_memory:on,ignore_denormal_mode:on +

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-07 Thread Yaxun Liu via cfe-commits
@@ -569,19 +569,21 @@ void AMDGPUTargetCodeGenInfo::setTargetAtomicMetadata( AtomicInst.setMetadata(llvm::LLVMContext::MD_noalias_addrspace, ASRange); } - if (!RMW || !CGF.getTarget().allowAMDGPUUnsafeFPAtomics()) + if (!RMW) return; - // TODO: Introduce new, m

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-07 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-07 Thread Yaxun Liu via cfe-commits
@@ -1093,6 +1097,169 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread Artem Belevich via cfe-commits
@@ -1093,6 +1097,169 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +/// Atomic control options +class AtomicOptionsOverride; +class AtomicOptions { +public: + using storage_type = uint16_t; + + static constexpr unsign

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Yaxun (Sam) Liu (yxsamliu) Changes Add option and statement attribute for controlling emitting of target-specific metadata to atomicrmw instructions in IR. The RFC for this attribute and option is https://discourse.llvm.org/t/rfc-a

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,19 @@ +//===--- AtomicOptions.def - Atomic Options database -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread Matt Arsenault via cfe-commits
@@ -569,19 +569,21 @@ void AMDGPUTargetCodeGenInfo::setTargetAtomicMetadata( AtomicInst.setMetadata(llvm::LLVMContext::MD_noalias_addrspace, ASRange); } - if (!RMW || !CGF.getTarget().allowAMDGPUUnsafeFPAtomics()) + if (!RMW) return; - // TODO: Introduce new, m

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s +// RUN: %clang_cc1 -fsyntax-only -verify -fcuda-is-device %s \ +// RUN: -fatomic=no_fine_grained_memory:off,no_remote_memory:on,ignore_denormal_mode:on +

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Yaxun (Sam) Liu (yxsamliu) Changes Add option and statement attribute for controlling emitting of target-specific metadata to atomicrmw instructions in IR. The RFC for this attribute and option is https://discourse.llvm.org/t/rfc

[clang] Add clang atomic control options and attribute (PR #114841)

2024-11-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yaxun (Sam) Liu (yxsamliu) Changes Add option and statement attribute for controlling emitting of target-specific metadata to atomicrmw instructions in IR. The RFC for this attribute and option is https://discourse.llvm.org/t/rfc-add-clan