From 0961ef21c73b09e33c6e0b17e58ef90207721e6a Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 17 Oct 2018 21:39:12 +0000 Subject: [PATCH] AMDGPU: Add options to enable/disable code object v3 Differential Revision: https://reviews.llvm.org/D53386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344711 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 5 +++++ test/Driver/amdgpu-features.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 166f913211..bc2d935313 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -2085,6 +2085,11 @@ def mamdgpu_debugger_abi : Joined<["-"], "mamdgpu-debugger-abi=">, Group, HelpText<"Generate additional code for specified of debugger ABI (AMDGPU only)">, MetaVarName<"">; + +def mcode_object_v3 : Flag<["-"], "mcode-object-v3">, Group, + HelpText<"Enable code object v3 (AMDGPU only)">; +def mno_code_object_v3 : Flag<["-"], "mno-code-object-v3">, Group, + HelpText<"Disable code object v3 (AMDGPU only)">; def mxnack : Flag<["-"], "mxnack">, Group, HelpText<"Enable XNACK (AMDGPU only)">; def mno_xnack : Flag<["-"], "mno-xnack">, Group, diff --git a/test/Driver/amdgpu-features.c b/test/Driver/amdgpu-features.c index 0e54a5e251..05c35d6daf 100644 --- a/test/Driver/amdgpu-features.c +++ b/test/Driver/amdgpu-features.c @@ -6,6 +6,12 @@ // RUN: | FileCheck --check-prefix=CHECK-MAMDGPU-DEBUGGER-ABI-1-0 %s // CHECK-MAMDGPU-DEBUGGER-ABI-1-0: "-target-feature" "+amdgpu-debugger-insert-nops" "-target-feature" "+amdgpu-debugger-emit-prologue" +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=CODE-OBJECT-V3 %s +// CODE-OBJECT-V3: "-target-feature" "+code-object-v3" + +// RUN: %clang -### -target amdgcn -mcpu=gfx700 -mno-code-object-v3 %s 2>&1 | FileCheck --check-prefix=NO-CODE-OBJECT-V3 %s +// NO-CODE-OBJECT-V3: "-target-feature" "-code-object-v3" + // RUN: %clang -### -target amdgcn -mcpu=gfx700 -mxnack %s 2>&1 | FileCheck --check-prefix=XNACK %s // XNACK: "-target-feature" "+xnack" -- 2.40.0