Skip to content

[mlir][SPIR-V] Use ToolSubst for spirv-tools lit substitutions#194609

Merged
aobolensk merged 1 commit into
llvm:mainfrom
aobolensk:mlir-spirv-lit-config
Apr 29, 2026
Merged

[mlir][SPIR-V] Use ToolSubst for spirv-tools lit substitutions#194609
aobolensk merged 1 commit into
llvm:mainfrom
aobolensk:mlir-spirv-lit-config

Conversation

@aobolensk
Copy link
Copy Markdown
Contributor

Bare-string substitutions match as substrings and the replacement path contains the tool name, causing corrupted RUN lines

Mirrors the LLVM-side fix from #192462

Bare-string substitutions match as substrings and the replacement path contains the tool name, causing corrupted RUN lines

Mirrors the LLVM-side fix from llvm#192462
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 28, 2026

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-spirv

Author: Arseniy Obolenskiy (aobolensk)

Changes

Bare-string substitutions match as substrings and the replacement path contains the tool name, causing corrupted RUN lines

Mirrors the LLVM-side fix from #192462


Full diff: https://github.com/llvm/llvm-project/pull/194609.diff

1 Files Affected:

  • (modified) mlir/test/Target/SPIRV/lit.local.cfg (+2-2)
diff --git a/mlir/test/Target/SPIRV/lit.local.cfg b/mlir/test/Target/SPIRV/lit.local.cfg
index 6d44394c8cd4f..9d158cf82b5be 100644
--- a/mlir/test/Target/SPIRV/lit.local.cfg
+++ b/mlir/test/Target/SPIRV/lit.local.cfg
@@ -1,4 +1,4 @@
 if config.spirv_tools_tests:
     config.available_features.add("spirv-tools")
-    config.substitutions.append(("spirv-as", os.path.join(config.llvm_tools_dir, "spirv-as")))
-    config.substitutions.append(("spirv-val", os.path.join(config.llvm_tools_dir, "spirv-val")))
+    from lit.llvm import llvm_config
+    llvm_config.add_tool_substitutions(["spirv-as", "spirv-val"])

@IgWod IgWod requested a review from davidegrohmann April 28, 2026 15:39
Copy link
Copy Markdown
Contributor

@IgWod IgWod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@aobolensk aobolensk merged commit 0e513fc into llvm:main Apr 29, 2026
14 checks passed
config.available_features.add("spirv-tools")
config.substitutions.append(("spirv-as", os.path.join(config.llvm_tools_dir, "spirv-as")))
config.substitutions.append(("spirv-val", os.path.join(config.llvm_tools_dir, "spirv-val")))
from lit.llvm import llvm_config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also need to fix it on the llvm/clang side?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fixes are already done & merged:

LLVM fix: #192462
clang fix: #192906

kirthana14m pushed a commit to ROCm/llvm-project that referenced this pull request Apr 30, 2026
…194609)

Bare-string substitutions match as substrings and the replacement path
contains the tool name, causing corrupted RUN lines

Mirrors the LLVM-side fix from llvm#192462
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants