Skip to content

Commit 4b2e7d0

Browse files
[amdgpu] Default to code object v3
[amdgpu] Default to code object v3 v4 is not yet readily available, and doesn't appear to be implemented in the back end Reviewed By: t-tye Differential Revision: https://reviews.llvm.org/D93258
1 parent d2ed9d6 commit 4b2e7d0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ def mexec_model_EQ : Joined<["-"], "mexec-model=">, Group<m_wasm_Features_Driver
28112811
HelpText<"Execution model (WebAssembly only)">;
28122812

28132813
def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
2814-
HelpText<"Specify code object ABI version. Defaults to 4. (AMDGPU only)">,
2814+
HelpText<"Specify code object ABI version. Defaults to 3. (AMDGPU only)">,
28152815
MetaVarName<"<version>">, Values<"2,3,4">;
28162816

28172817
def mcode_object_v3_legacy : Flag<["-"], "mcode-object-v3">, Group<m_Group>,

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ unsigned tools::getOrCheckAMDGPUCodeObjectVersion(
15491549
const Driver &D, const llvm::opt::ArgList &Args, bool Diagnose) {
15501550
const unsigned MinCodeObjVer = 2;
15511551
const unsigned MaxCodeObjVer = 4;
1552-
unsigned CodeObjVer = 4;
1552+
unsigned CodeObjVer = 3;
15531553

15541554
// Emit warnings for legacy options even if they are overridden.
15551555
if (Diagnose) {

llvm/docs/AMDGPUUsage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -911,12 +911,12 @@ The AMDGPU backend uses the following ELF header:
911911

912912
* ``ELFABIVERSION_AMDGPU_HSA_V3`` is used to specify the version of AMD HSA
913913
runtime ABI for code object V3. Specify using the Clang option
914-
``-mcode-object-version=3``.
914+
``-mcode-object-version=3``. This is the default code object
915+
version if not specified.
915916

916917
* ``ELFABIVERSION_AMDGPU_HSA_V4`` is used to specify the version of AMD HSA
917918
runtime ABI for code object V4. Specify using the Clang option
918-
``-mcode-object-version=4``. This is the default code object
919-
version if not specified.
919+
``-mcode-object-version=4``.
920920

921921
* ``ELFABIVERSION_AMDGPU_PAL`` is used to specify the version of AMD PAL
922922
runtime ABI.
@@ -2871,10 +2871,6 @@ non-AMD key names should be prefixed by "*vendor-name*.".
28712871
Code Object V3 Metadata
28722872
+++++++++++++++++++++++
28732873

2874-
.. warning::
2875-
Code object V3 is not the default code object version emitted by this version
2876-
of LLVM.
2877-
28782874
Code object V3 to V4 metadata is specified by the ``NT_AMDGPU_METADATA`` note
28792875
record (see :ref:`amdgpu-note-records-v3-v4`).
28802876

@@ -3279,6 +3275,10 @@ same *vendor-name*.
32793275
Code Object V4 Metadata
32803276
+++++++++++++++++++++++
32813277

3278+
.. warning::
3279+
Code object V4 is not the default code object version emitted by this version
3280+
of LLVM.
3281+
32823282
Code object V4 metadata is the same as
32833283
:ref:`amdgpu-amdhsa-code-object-metadata-v3` with the changes and additions
32843284
defined in table :ref:`amdgpu-amdhsa-code-object-metadata-map-table-v3`.

0 commit comments

Comments
 (0)