[llvm] [offload][test] Add fallback to legacy AMDGPU triple library dir (PR #209131)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 03:13:17 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Robert Imschweiler (ro-i)
<details>
<summary>Changes</summary>
After the amdgcn-amd-amdhsa -> amdgpu-amd-amdhsa rename, look up the device runtime libraries in the legacy directory when the runtime was built under the old triple name.
Claude assisted with this patch.
---
Full diff: https://github.com/llvm/llvm-project/pull/209131.diff
1 Files Affected:
- (modified) offload/test/lit.cfg (+10-3)
``````````diff
diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index 0b7ca00778acc..9dc4e73e4f4c0 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -247,9 +247,16 @@ if config.libomptarget_current_target in host_targets:
config.available_features.add('host')
def get_target_library_dir():
- return os.path.join(
- config.llvm_library_dir,
- remove_suffix_if_present(config.libomptarget_current_target))
+ target = remove_suffix_if_present(config.libomptarget_current_target)
+ library_dir = os.path.join(config.llvm_library_dir, target)
+ # The AMDGPU offload triple was renamed amdgcn-amd-amdhsa ->
+ # amdgpu-amd-amdhsa. Fall back to the legacy directory when the runtime was
+ # built under the old triple name.
+ if target == amdgpu_target and not os.path.isdir(library_dir):
+ legacy_dir = os.path.join(config.llvm_library_dir, legacy_amdgpu_target)
+ if os.path.isdir(legacy_dir):
+ return legacy_dir
+ return library_dir
if "gpu" in config.available_features and "intelgpu" not in config.available_features:
config.test_flags += " -Xoffload-linker -L" + get_target_library_dir()
``````````
</details>
https://github.com/llvm/llvm-project/pull/209131
More information about the llvm-commits
mailing list