Skip to content

Commit

Permalink
Revert "[Comgr] Add -relink-builtin-bitcode-postop to device library …
Browse files Browse the repository at this point in the history
…linking"

This reverts commit 005d151.

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
  • Loading branch information
lamb-j authored and yanyao-wang committed May 15, 2024
1 parent 96b2ba3 commit 669db88
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions amd/comgr/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
2 changes: 0 additions & 2 deletions amd/comgr/src/comgr-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit 669db88

Please sign in to comment.