[llvm-branch-commits] [clang] Ofast deprecation clarifications (PR #101005)
Sjoerd Meijer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jul 29 05:40:30 PDT 2024
https://github.com/sjoerdmeijer created https://github.com/llvm/llvm-project/pull/101005
Following up on the RFC discussion, this is clarifying that the main purpose and effect of the -Ofast deprecation is to discourage its usage and that everything else is more or less open for discussion, e.g. there is no timeline yet for removal.
>From 7357ef4d5b346d0c317ff09c6700fa944f6ae770 Mon Sep 17 00:00:00 2001
From: Sjoerd Meijer <smeijer at nvidia.com>
Date: Mon, 29 Jul 2024 17:04:48 +0530
Subject: [PATCH] Ofast deprecation clarifications
Following up on the RFC discussion, this is clarifying that the main purpose
and effect of the -Ofast deprecation is to discourage its usage and that
everything else is more or less open for discussion, e.g. there is no timeline
yet for removal.
---
clang/docs/CommandGuide/clang.rst | 7 +++++--
clang/docs/ReleaseNotes.rst | 10 ++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index 663aca1f6ddcb..6ce340b20c252 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -429,8 +429,11 @@ Code Generation Options
:option:`-Ofast` Enables all the optimizations from :option:`-O3` along
with other aggressive optimizations that may violate strict compliance with
- language standards. This is deprecated in favor of :option:`-O3`
- in combination with :option:`-ffast-math`.
+ language standards. This is deprecated in Clang-19 and a warning is emitted
+ that :option:`-O3` in combination with :option:`-ffast-math` should be used
+ instead if the request for non-standard math behavior is intended. Thus, as
+ there is no timeline yet for removal, the aim is to discourage its usage
+ due to the compliance violating optimizations.
:option:`-Os` Like :option:`-O2` with extra optimizations to reduce code
size.
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 71d615553c613..430fa77218954 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -495,10 +495,12 @@ New Compiler Flags
Deprecated Compiler Flags
-------------------------
-- The ``-Ofast`` command-line option has been deprecated. This option both
- enables the ``-O3`` optimization-level, as well as enabling non-standard
- ``-ffast-math`` behaviors. As such, it is somewhat misleading as an
- "optimization level". Users are advised to switch to ``-O3 -ffast-math`` if
+- The ``-Ofast`` command-line option has been deprecated, but there is no
+ timeline for removal yet. Thus, the main effect of emitting a deprecation
+ warning message is to discourage its usage due to the problems of ``-Ofast``:
+ it enables both the ``-O3`` optimization-level as well as non-standard
+ ``-ffast-math`` behaviors and as such it is perceived to be misleading as an
+ optimization level. Users are advised to switch to ``-O3 -ffast-math`` if
the use of non-standard math behavior is intended, and ``-O3`` otherwise.
See `RFC <https://discourse.llvm.org/t/rfc-deprecate-ofast/78687>`_ for details.
More information about the llvm-branch-commits
mailing list