Skip to content

Commit eb64fe6

Browse files
author
Colin Davidson
committed
UPdated
1 parent 59f671b commit eb64fe6

13 files changed

Lines changed: 371 additions & 4 deletions

scripts/commit.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Bring native cpu pipeline files into dpc++ directly.
2+
3+
This brings the native cpu compiler pipeline files directly under the ownership
4+
of intel/llvm. This removes the direct dependence on the oneAPI Construction
5+
Kit, although the history of those files still exists under intel/llvm and the
6+
originals still exist at
7+
https://github.com/uxlfoundation/oneapi-construction-kit.
8+
9+
This was done as follows:
10+
11+
In the oneAPI Construction Kit repo:
12+
```
13+
git-filter-repo --paths-from-file $script_dir/native_cpu_paths.txt \
14+
--path-rename modules/compiler/compiler_pipeline:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline \
15+
--path-rename modules/compiler/vecz:llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz \
16+
--path-rename modules/compiler/multi_llvm/include/multi_llvm:llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm
17+
```
18+
19+
Under intel/llvm:
20+
```
21+
git checkout sycl
22+
git checkout -b $llvm_branch
23+
git fetch $ock_fork $ock_branch
24+
git merge -m "[NATIVE_CPU][SYCL] Merge from oneAPI Construction Kit into native_cpu" --allow-unrelated-histories ock_fork/$ock_branch
25+
```
26+
27+
Additionally, updated various CMakeLists.txt to use llvm macros. across
28+
`compiler_pipeline` and `vecz` and pushed to a branch, as well as setting
29+
`NATIVECPU_USE_OCK` to be on in sycl-linux-build.yml.
30+
31+
32+
Also `llvm/lib/SYCLNativeCPUUtils/CMakeLists.txt` was updated to remove the fetch content and remove the ugly install workaround.
33+
Missing is the lit tests for the pipeline test as these refer to the use of a non-ported tool, `muxc`.

scripts/create_native_cpu.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if [ "$ock_branch" != "" ]; then
3636
git clean -d -f
3737
git branch -D $llvm_branch || true
3838
git remote add ock_fork git@github.com:${ock_user}/oneapi-construction-kit.git || true
39+
git remote add llvm_fork git@github.com:${ock_user}/llvm.git || true
3940
git checkout -b $llvm_branch
4041
git fetch ock_fork $ock_branch
4142
git merge -m "[NATIVE_CPU][SYCL] Merge from oneAPI Construction Kit into native_cpu" --allow-unrelated-histories ock_fork/$ock_branch
@@ -56,10 +57,10 @@ if [ "$ock_branch" != "" ]; then
5657
cp $script_dir/native_cpu_vecz_test_lit_lit.cfg.py llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/lit.cfg.py
5758
cp $script_dir/native_cpu_vecz_test_lit_lit.site.cfg.py.in llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/lit.site.cfg.py.in
5859
cp $script_dir/native_cpu_vecz_test_lit_llvm_RISCV_lit.local.cfg llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/RISCV/lit.local.cfg
59-
git apply --index $script_dir/native_cpu_vecz_lit.patch
60-
git add llvm/lib/SYCLNativeCPUUtils .github/workflows/sycl-linux-build.yml
6160
git rm $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/partial_linearization22-llvm18.ll
6261
git rm $llvm_repo/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/ScalableVectors/lit.local.cfg
62+
sed -i 's/{{undef|poison}}/poison/g' llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll
63+
git add llvm/lib/SYCLNativeCPUUtils .github/workflows/sycl-linux-build.yml
6364
git commit -F $script_dir/native_cpu_commit_message.txt
6465
fi
6566
fi

scripts/native_cpu_CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ if(NATIVECPU_USE_OCK)
3939
target_include_directories(LLVMSYCLNativeCPUUtils PRIVATE
4040
${CMAKE_CURRENT_SOURCE_DIR}/compiler_passes/compiler_pipeline/include
4141
${CMAKE_CURRENT_SOURCE_DIR}/compiler_passes/vecz/include)
42-
endif()
42+
endif()

scripts/native_cpu_commit_message.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ rather in the style of oneAPI Construction Kit. It also applies clang-format-20
1616
A brief explanation and limitations of the importing of the files are under l
1717
lvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_passes.rst.
1818

19-
It also updates the NATIVECPU_USE_OCK to be on in sycl-linux-build.yml.
19+
It also updates the NATIVECPU_USE_OCK to be on in sycl-linux-build.yml. There is also a
20+
check-sycl-vecz target added for the vecz lit tests.
2021

2122

2223

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Compiler passes
2+
===============
3+
4+
Introduction
5+
------------
6+
7+
Files under this directory are ported from the [oneAPI Construction
8+
Kit](https://github.com/uxlfoundation/oneapi-construction-kit). They are used by
9+
NativeCPU to help create a pipeline for turning a base kernel into something
10+
which can be executed across multiple work items, including auto-vectorization.
11+
12+
These files are largely from the sub-directories
13+
**modules/compiler/compiler_pipeline**, **modules/compiler/vecz** and
14+
**modules/compiler/multi_llvm**. Only files that are used have been copied and
15+
the **Cmake** files have been updated to fit in with LLVM components.
16+
17+
These sub-directories are used as follows:
18+
19+
* **compiler_pipeline** provides the passes to build a pipeline from the initial
20+
kernel, including generating working item loops, handling local memory,
21+
handling metadata and calling the vectorizer **vecz**.
22+
23+
* **vecz** provides a full function vectorizer, which generates a copy of the
24+
original function but vectorized across the work group, taking into account
25+
subgroups.
26+
27+
* **multi_llvm**. This provides some support for these functions to work across
28+
multiple LLVM versions. Although this is not strictly needed in LLVM, it has
29+
been ported across to allow the port to go smoothly, without changing files
30+
directly. Note this is header only and exists under
31+
**compiler_pipeline/include/multi_llvm**.
32+
33+
**compiler_pipeline** is documented in :doc:`/compiler_pipeline/docs/compiler`
34+
and **vecz** is documented in :doc:`/vecz/vecz`. Note that there are several
35+
limitations both in the documentation and in the code that are a result of the
36+
initial port. These should be addressed.
37+
38+
General limitations
39+
-------------------
40+
41+
There is the following limitations in the current port:
42+
43+
* The documentation makes a lot of references to **oneAPI Construction Kit**
44+
constructs such as ComputeMux. It also references files that have not been
45+
copied across.
46+
* The namespace in **compiler_pipeline** is **compiler/utils**, the namespace in
47+
multi_llvm is **multi_llvm** and the namespace in **vecz** is **vecz**. These should
48+
be updated to reflect being under **LLVM**.
49+
* include files should ideally be moved to under **llvm/include** but remain under
50+
these directories after the port.
51+
* **vecz** has a test tool **veczc** and associated **lit** tests. This tool if
52+
required should be moved under **llvm/tools** or **llvm/test**. This is also
53+
requires `NATIVE_CPU_BUILD_VECZ_TEST_TOOLS` cmake option to build. This can be
54+
run using the target `check-sycl-vecz`.
55+
* **compiler_pipeline** has lit tests for the passes which have not been ported
56+
across. This is because they use a tool **muxc**, but these passes should be
57+
able to be tested using opt. These lit tests can be found
58+
[here](https://github.com/uxlfoundation/oneapi-construction-kit/tree/main/modules/compiler/test/lit/passes).
59+
* There are many files that are unlikely to have any code coverage but because
60+
there are referred to in other files which we do need, they exist here. These
61+
should be pruned over time as a better understanding is made of what is
62+
required.
63+
64+
.. _oneAPI Construction Kit: https://github.com/uxlfoundation/oneapi-construction-kit

scripts/native_cpu_vecz_CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ target_compile_definitions(LLVMNativeCPUVecz PRIVATE
127127
${VECZ_COMPILE_DEFINITIONS})
128128

129129
# Currently disabled by default, these allow us to run lit tests using veczc
130+
# with the target check-sycl-vecz
130131
set(NATIVE_CPU_BUILD_VECZ_TEST_TOOLS OFF CACHE BOOL "Build vecz test and tools")
131132
if (NATIVE_CPU_BUILD_VECZ_TEST_TOOLS)
132133
add_subdirectory(tools)

scripts/native_cpu_vecz_lit.patch

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
From 1940844fb8e77df8343203b29a5308823d11650d Mon Sep 17 00:00:00 2001
2+
From: Colin Davidson <colin.davidson@codeplay.com>
3+
Date: Fri, 29 Aug 2025 13:59:14 +0100
4+
Subject: [PATCH] Update lit tests
5+
6+
---
7+
.../llvm/VectorPredication/packetize_mask_varying.ll | 8 ++------
8+
.../test/lit/llvm/inlined_function_debug_info.ll | 3 +--
9+
.../vecz/test/lit/llvm/insert_element_debug_info.ll | 3 +--
10+
.../vecz/test/lit/llvm/irreducible_loop.ll | 12 ++----------
11+
.../vecz/test/lit/llvm/packetization_debug_info.ll | 3 +--
12+
.../vecz/test/lit/llvm/phi_node_debug_info.ll | 3 +--
13+
.../vecz/test/lit/llvm/scalarization_debug_info.ll | 3 +--
14+
7 files changed, 9 insertions(+), 26 deletions(-)
15+
16+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/VectorPredication/packetize_mask_varying.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/VectorPredication/packetize_mask_varying.ll
17+
index 5c1df71ed947..0ce65b9f4ca0 100644
18+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/VectorPredication/packetize_mask_varying.ll
19+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/VectorPredication/packetize_mask_varying.ll
20+
@@ -14,8 +14,7 @@
21+
;
22+
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
23+
24+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
25+
-; RUN: veczc -k mask_varying -vecz-scalable -vecz-simd-width=4 -vecz-choices=VectorPredication -S < %s | FileCheck %t
26+
+; RUN: veczc -k mask_varying -vecz-scalable -vecz-simd-width=4 -vecz-choices=VectorPredication -S < %s | FileCheck %s
27+
28+
target triple = "spir64-unknown-unknown"
29+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
30+
@@ -40,10 +39,7 @@ if.end:
31+
; CHECK: define spir_kernel void @__vecz_nxv4_vp_mask_varying
32+
; CHECK: [[CMP:%.*]] = icmp slt <vscale x 4 x i64> %{{.*}},
33+
; CHECK: [[RED:%.*]] = call i1 @llvm.vp.reduce.or.nxv4i1(i1 false, <vscale x 4 x i1> [[CMP]], {{.*}}, i32 {{.*}})
34+
-; CHECK-LT20: [[REINS:%.*]] = insertelement <4 x i1> poison, i1 [[RED]], {{(i32|i64)}} 0
35+
-; CHECK-LT20: [[RESPLAT:%.*]] = shufflevector <4 x i1> [[REINS]], <4 x i1> poison, <4 x i32> zeroinitializer
36+
-; CHECK-LT20: [[VAL:%.*]] = call <4 x i32> @__vecz_b_masked_load16_Dv4_ju3ptrDv4_b(ptr %aptr, <4 x i1> [[RESPLAT]])
37+
-; CHECK-GE20: [[VAL:%.*]] = load <4 x i32>, ptr %aptr
38+
+; CHECK: [[VAL:%.*]] = load <4 x i32>, ptr %aptr
39+
}
40+
41+
declare i64 @__mux_get_global_id(i32)
42+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/inlined_function_debug_info.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/inlined_function_debug_info.ll
43+
index c14a5a421f95..ce041960424b 100644
44+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/inlined_function_debug_info.ll
45+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/inlined_function_debug_info.ll
46+
@@ -16,8 +16,7 @@
47+
48+
; Check VECZ debug info for inlined DILocation metadata nodes
49+
50+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
51+
-; RUN: veczc -k functions_one -vecz-passes=builtin-inlining -vecz-simd-width=4 -S < %s | FileCheck %t
52+
+; RUN: veczc -k functions_one -vecz-passes=builtin-inlining -vecz-simd-width=4 -S < %s | FileCheck %s
53+
54+
; ModuleID = '/tmp/inlined_function.ll'
55+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
56+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/insert_element_debug_info.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/insert_element_debug_info.ll
57+
index 5f82e99e6d58..a0a72bfe7271 100644
58+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/insert_element_debug_info.ll
59+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/insert_element_debug_info.ll
60+
@@ -18,8 +18,7 @@
61+
; intrinsics across all lanes even when scalarization masks disable some
62+
; of the lanes. This occurs when we scalarize insertelement instructions.
63+
64+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
65+
-; RUN: veczc -k unaligned_load -vecz-passes="function(instcombine,adce),scalarize,packetizer,instcombine" -vecz-simd-width=4 -vecz-choices=FullScalarization -S < %s | FileCheck %t
66+
+; RUN: veczc -k unaligned_load -vecz-passes="function(instcombine,adce),scalarize,packetizer,instcombine" -vecz-simd-width=4 -vecz-choices=FullScalarization -S < %s | FileCheck %s
67+
68+
; ModuleID = 'kernel.opencl'
69+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
70+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/irreducible_loop.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/irreducible_loop.ll
71+
index e81e139e52da..770a31740a8b 100644
72+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/irreducible_loop.ll
73+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/irreducible_loop.ll
74+
@@ -14,8 +14,7 @@
75+
;
76+
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77+
78+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
79+
-; RUN: veczc -k irreducible_loop -S < %s | FileCheck %t
80+
+; RUN: veczc -k irreducible_loop -S < %s | FileCheck %s
81+
82+
; ModuleID = 'Unknown buffer'
83+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
84+
@@ -49,17 +48,10 @@ declare i64 @__mux_get_global_id(i32)
85+
86+
; CHECK: define spir_kernel void @__vecz_v4_irreducible_loop
87+
; CHECK: entry:
88+
-; CHECK-LT20: br label %irr.guard.outer
89+
-
90+
-; CHECK-LT20: irr.guard.outer: ; preds = %irr.guard.pure_exit, %entry
91+
; CHECK: br label %irr.guard
92+
93+
-; CHECK-LT20: do.end: ; preds = %irr.guard.pure_exit
94+
-; CHECK-LT20: ret void
95+
-
96+
; CHECK: irr.guard:
97+
; CHECK: br i1 %{{.+}}, label %irr.guard.pure_exit, label %irr.guard
98+
99+
; CHECK: irr.guard.pure_exit: ; preds = %irr.guard
100+
-; CHECK-LT20: br i1 %{{.+}}, label %do.end, label %irr.guard.outer
101+
-; CHECK-GE20: ret void
102+
+; CHECK: ret void
103+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll
104+
index eaaba4463f9e..456414d1c22f 100644
105+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll
106+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/packetization_debug_info.ll
107+
@@ -17,8 +17,7 @@
108+
; Check that debug info is preserved in the vectorized kernel.
109+
; Specifically that the packetization pass creates vector types
110+
; in the DI for the variables.
111+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
112+
-; RUN: veczc -k add -S < %s | FileCheck %t
113+
+; RUN: veczc -k add -S < %s | FileCheck %s
114+
115+
; ModuleID = 'kernel.opencl'
116+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
117+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/phi_node_debug_info.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/phi_node_debug_info.ll
118+
index 8e6c5a095423..aabbd65bf105 100644
119+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/phi_node_debug_info.ll
120+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/phi_node_debug_info.ll
121+
@@ -17,8 +17,7 @@
122+
; Check that debug info intrinsics are correctly placed after
123+
; phi nodes.
124+
125+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
126+
-; RUN: veczc -vecz-simd-width=4 -S < %s | FileCheck %t
127+
+; RUN: veczc -vecz-simd-width=4 -S < %s | FileCheck %s
128+
129+
; ModuleID = 'kernel.opencl'
130+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
131+
diff --git a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/scalarization_debug_info.ll b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/scalarization_debug_info.ll
132+
index 85189b3651eb..2e7c1a2202c7 100644
133+
--- a/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/scalarization_debug_info.ll
134+
+++ b/llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/test/lit/llvm/scalarization_debug_info.ll
135+
@@ -18,8 +18,7 @@
136+
; Specifically that the scalarization pass doesn't destroy DI
137+
; intrinsics attached to the vector instructions it scalarizes.
138+
139+
-; RUN: %pp-llvm-ver -o %t < %s --llvm-ver %LLVMVER
140+
-; RUN: veczc -k mul2 -vecz-passes="scalarize,function(mem2reg)" -vecz-choices=FullScalarization -S < %s | FileCheck %t
141+
+; RUN: veczc -k mul2 -vecz-passes="scalarize,function(mem2reg)" -vecz-choices=FullScalarization -S < %s | FileCheck %s
142+
143+
; ModuleID = 'kernel.opencl'
144+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
145+
--
146+
2.51.0
147+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
configure_lit_site_cfg(
2+
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
3+
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
4+
MAIN_CONFIG
5+
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
6+
PATHS
7+
"CMAKE_OSX_SYSROOT"
8+
"LLVM_SOURCE_DIR"
9+
"LLVM_BINARY_DIR"
10+
"LLVM_TOOLS_DIR"
11+
"LLVM_LIBS_DIR"
12+
"SHLIBDIR"
13+
)
14+
15+
# TODO: Consider adding to check-sycl if this is every moved to under llvm/tests
16+
# Add a target to invoke tests via Ninja/make.
17+
add_lit_testsuite(check-sycl-vecz-tests "Running SYCL vecz lit tests"
18+
"${CMAKE_CURRENT_BINARY_DIR}"
19+
20+
DEPENDS
21+
veczc
22+
FileCheck
23+
)
24+
25+
add_custom_target(check-sycl-vecz)
26+
add_dependencies(check-sycl-vecz check-sycl-vecz-tests)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lit)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) Codeplay Software Limited
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License") with LLVM
4+
# Exceptions; you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://github.com/uxlfoundation/oneapi-construction-kit/blob/main/LICENSE.txt
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
16+
"""Python configuration file for lit."""
17+
18+
import os
19+
import lit.formats
20+
from lit.llvm import llvm_config
21+
22+
23+
# Name of the test suite.
24+
config.name = "LLVM"
25+
26+
# File extensions for testing.
27+
config.suffixes = [".hlsl", ".ll"]
28+
29+
# The test format used to interpret tests.
30+
config.test_format = lit.formats.ShTest(execute_external=False)
31+
32+
# The root path where tests are located.
33+
config.test_source_root = os.path.dirname(__file__)
34+
35+
llvm_config.with_environment(
36+
"PATH", os.path.abspath(config.llvm_tools_dir), append_path=True
37+
)

0 commit comments

Comments
 (0)