[llvm] [SPIR-V] Use ToolSubst for spirv-tools lit substitutions (PR #192462)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 07:10:59 PDT 2026
https://github.com/aobolensk created https://github.com/llvm/llvm-project/pull/192462
Bare-string substitutions match as substrings and the replacement path contains the tool name, causing corrupted RUN lines
The issue is reproducible, for example, when path to llvm has tool name substring at any point
>From d3634bd23452d854685e7519e89b8e092040652c Mon Sep 17 00:00:00 2001
From: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
Date: Thu, 16 Apr 2026 16:07:55 +0200
Subject: [PATCH] [SPIR-V] Use ToolSubst for spirv-tools lit substitutions
Bare-string substitutions match as substrings and the replacement path contains the tool name, causing corrupted RUN lines. Use add_tool_substitutions() for word-boundary-aware matching, consistent with how all other LLVM tools are registered
The issue is reproducible, for example, when path to llvm has tool name substring at any point
---
llvm/test/CodeGen/SPIRV/lit.local.cfg | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/test/CodeGen/SPIRV/lit.local.cfg b/llvm/test/CodeGen/SPIRV/lit.local.cfg
index 51795425cc887..59d93b548ea1d 100644
--- a/llvm/test/CodeGen/SPIRV/lit.local.cfg
+++ b/llvm/test/CodeGen/SPIRV/lit.local.cfg
@@ -3,7 +3,7 @@ if not "SPIRV" in config.root.targets:
if config.spirv_tools_tests:
config.available_features.add("spirv-tools")
- config.substitutions.append(("spirv-dis", os.path.join(config.llvm_tools_dir, "spirv-dis")))
- config.substitutions.append(("spirv-val", os.path.join(config.llvm_tools_dir, "spirv-val")))
- config.substitutions.append(("spirv-as", os.path.join(config.llvm_tools_dir, "spirv-as")))
- config.substitutions.append(("spirv-link", os.path.join(config.llvm_tools_dir, "spirv-link")))
+ from lit.llvm import llvm_config
+ llvm_config.add_tool_substitutions(
+ ["spirv-dis", "spirv-val", "spirv-as", "spirv-link"]
+ )
More information about the llvm-commits
mailing list