From 669db884972e769450470020c06a6f132a8a065b Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 29 Apr 2024 10:15:55 -0700 Subject: [PATCH] Revert "[Comgr] Add -relink-builtin-bitcode-postop to device library linking" This reverts commit 005d151eefb697331ff643258904eee128050fe0. This commit can be reverted for 6.1 release branch: - Only hipRTC uses the COMPILE_SOURCE_WITH_DEVICE_LIBRARIES_TO_BC - For hip contexts we don't run AMDGPUSimplifyLibCalls, so relinking isn't needed Change-Id: Id203bccfeb8c3718e0e84a55b3559d1c0faba609 --- amd/comgr/docs/ReleaseNotes.md | 5 +---- amd/comgr/src/comgr-compiler.cpp | 2 -- amd/comgr/test/compile_source_with_device_libs_to_bc_test.c | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/amd/comgr/docs/ReleaseNotes.md b/amd/comgr/docs/ReleaseNotes.md index 6c1bcb10dec9b..0185f2a987b54 100644 --- a/amd/comgr/docs/ReleaseNotes.md +++ b/amd/comgr/docs/ReleaseNotes.md @@ -59,10 +59,7 @@ lld::elf::link in Comgr's linkWithLLD() - Added -x assembler option to assembly compilation. Before, if an assembly file did not end with a .s file extension, it was not handled properly by the Comgr ASSEMBLE\_SOURCE\_TO\_RELOCATABLE action. -- Added new -relink-builtin-bitcode-postop LLVM option to device library. This -fixes an issue with the \*COMPILE\_SOURCE\_WITH\_DEVICE\_LIBRARIES\_TO\_BC where -OpenCL applications that leveraged AMDGPUSimplifyLibCalls optimizations would -need to re-link bitcodes separately to avoid errors at runtime. + New APIs -------- diff --git a/amd/comgr/src/comgr-compiler.cpp b/amd/comgr/src/comgr-compiler.cpp index dbf660d3b2379..81f4fae0c55a9 100644 --- a/amd/comgr/src/comgr-compiler.cpp +++ b/amd/comgr/src/comgr-compiler.cpp @@ -1074,8 +1074,6 @@ amd_comgr_status_t AMDGPUCompiler::addDeviceLibraries() { return AMD_COMGR_STATUS_ERROR; } Args.push_back(Saver.save(Twine("--rocm-path=") + FakeRocmDir).data()); - Args.push_back("-mllvm"); - Args.push_back("-relink-builtin-bitcode-postop"); NoGpuLib = false; for (auto DeviceLib : getDeviceLibraries()) { diff --git a/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c b/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c index f092a539d2110..5966ab4c43cde 100644 --- a/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c +++ b/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) { amd_comgr_action_info_t DataAction; amd_comgr_status_t Status; const char *CodeGenOptions[] = {"-mllvm", "-amdgpu-early-inline-all", - "-mcode-object-version=5", "-mllvm", "-amdgpu-prelink"}; + "-mcode-object-version=5"}; size_t CodeGenOptionsCount = sizeof(CodeGenOptions) / sizeof(CodeGenOptions[0]);