Skip to content

Revert "[Clang][HIP] Deprecate the AMDGCN_WAVEFRONT_SIZE macros" #115499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/docs/AMDGPUSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Predefined Macros
* - ``__AMDGCN_UNSAFE_FP_ATOMICS__``
- Defined if unsafe floating-point atomics are allowed.
* - ``__AMDGCN_WAVEFRONT_SIZE__``
- Defines the wavefront size. Allowed values are 32 and 64 (deprecated).
- Defines the wavefront size. Allowed values are 32 and 64.
* - ``__AMDGCN_WAVEFRONT_SIZE``
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated).
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__``. To be deprecated.
* - ``__HAS_FMAF__``
- Defined if FMAF instruction is available (deprecated).
* - ``__HAS_LDEXPF__``
Expand Down
2 changes: 1 addition & 1 deletion clang/docs/HIPSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Predefined Macros

Note that some architecture specific AMDGPU macros will have default values when
used from the HIP host compilation. Other :doc:`AMDGPU macros <AMDGPUSupport>`
like ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated) will default to 64 for example.
like ``__AMDGCN_WAVEFRONT_SIZE__`` will default to 64 for example.

Compilation Modes
=================
Expand Down
8 changes: 1 addition & 7 deletions clang/include/clang/Basic/MacroBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ class MacroBuilder {
MacroBuilder(raw_ostream &Output) : Out(Output) {}

/// Append a \#define line for macro of the form "\#define Name Value\n".
/// If DeprecationMsg is provided, also append a pragma to deprecate the
/// defined macro.
void defineMacro(const Twine &Name, const Twine &Value = "1",
Twine DeprecationMsg = "") {
void defineMacro(const Twine &Name, const Twine &Value = "1") {
Out << "#define " << Name << ' ' << Value << '\n';
if (!DeprecationMsg.isTriviallyEmpty())
Out << "#pragma clang deprecated(" << Name << ", \"" << DeprecationMsg
<< "\")\n";
}

/// Append a \#undef line for Name. Name should be of the form XXX
Expand Down
9 changes: 3 additions & 6 deletions clang/lib/Basic/Targets/AMDGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,9 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
if (hasFastFMA())
Builder.defineMacro("FP_FAST_FMA");

Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize),
"compile-time-constant access to the wavefront size will "
"be removed in a future release");
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE", Twine(WavefrontSize),
"compile-time-constant access to the wavefront size will "
"be removed in a future release");
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize));
// ToDo: deprecate this macro for naming consistency.
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE", Twine(WavefrontSize));
Builder.defineMacro("__AMDGCN_CUMODE__", Twine(CUMode));
}

Expand Down
111 changes: 0 additions & 111 deletions clang/test/Driver/hip-wavefront-size-deprecation-diagnostics.hip

This file was deleted.

Loading