Skip to content

Commit 00f2989

Browse files
authored
[HIP] Default to COV5 for HIP compilations (#116077)
Summary: This was done a long time ago for OpenMP, but it seems HIP was never updated. This patch rectifies that. The default for the LLVM backend is 5 so this is probably required for some stuff.
1 parent 48e09fe commit 00f2989

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2710,7 +2710,7 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
27102710

27112711
unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
27122712
const llvm::opt::ArgList &Args) {
2713-
unsigned CodeObjVer = 4; // default
2713+
unsigned CodeObjVer = 5; // default
27142714
if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
27152715
StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
27162716
return CodeObjVer;

clang/test/Driver/hip-device-libs.hip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@
157157
// Test default code object version.
158158
// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
159159
// RUN: --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
160-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI4
160+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI5
161161

162162
// Test default code object version with old device library without abi_version_400.bc
163163
// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
164-
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver \
164+
// RUN: -mcode-object-version=4 \
165+
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode-no-abi-ver \
165166
// RUN: --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
166167
// RUN: 2>&1 | FileCheck %s --check-prefixes=NOABI4
167168

0 commit comments

Comments
 (0)