Skip to content

Commit 5742769

Browse files
committed
Merge branch 'l0v2-tests' of github.com:luszczewskakasia1/llvm into l0v2-tests
2 parents 1ed2f64 + 97f2c78 commit 5742769

File tree

262 files changed

+2427
-2874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+2427
-2874
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,6 @@ jobs:
340340
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
341341
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd"
342342

343-
- name: Remove E2E tests before spirv-backend run
344-
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && !cancelled() && steps.build.conclusion == 'success' }}
345-
run: rm -rf build-e2e
346-
347343
- name: Build E2E tests with SPIR-V Backend
348344
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && !cancelled() && steps.build.conclusion == 'success' }}
349345
uses: ./devops/actions/run-tests/e2e
@@ -355,10 +351,6 @@ jobs:
355351
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
356352
extra_lit_opts: --param spirv-backend=True
357353

358-
- name: Remove E2E tests before preview-mode run
359-
if: ${{ inputs.e2e_binaries_preview_artifact && !cancelled() && steps.build.conclusion == 'success' }}
360-
run: rm -rf build-e2e
361-
362354
- name: Build E2E tests in Preview Mode
363355
if: ${{ inputs.e2e_binaries_preview_artifact && !cancelled() && steps.build.conclusion == 'success' }}
364356
uses: ./devops/actions/run-tests/e2e

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ jobs:
245245
sparse-checkout: |
246246
devops
247247
sycl/cts_exclude_filter
248+
- name: Show checkout information
249+
shell: bash
250+
run: |
251+
echo "Current branch: $(git branch --show-current)"
252+
echo "Current commit: $(git rev-parse HEAD)"
253+
echo "Current commit (short): $(git rev-parse --short HEAD)"
254+
echo "Commit message: $(git log -1 --pretty=%B)"
255+
git log -1 --oneline
248256
- name: Register cleanup after job is finished
249257
uses: ./devops/actions/cleanup
250258
- name: Reset Intel GPU

.github/workflows/ur-build-hw.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ on:
2929
required: true
3030
type: string
3131
default: ""
32+
install_igc_driver:
33+
required: false
34+
type: string
35+
default: ""
3236
workflow_dispatch:
3337
inputs:
3438
adapter_name:
@@ -57,6 +61,10 @@ on:
5761
required: true
5862
type: string
5963
default: ""
64+
install_igc_driver:
65+
required: false
66+
type: string
67+
default: ""
6068

6169
permissions: read-all
6270

@@ -118,7 +126,7 @@ jobs:
118126
119127
- name: Download DPC++
120128
run: |
121-
wget -O dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
129+
wget -O dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2025-11-28/sycl_linux.tar.gz
122130
mkdir -p dpcpp_compiler
123131
tar -xvf dpcpp_compiler.tar.gz -C dpcpp_compiler
124132
@@ -131,6 +139,13 @@ jobs:
131139
sudo apt-get update
132140
sudo apt-get install -y intel-oneapi-runtime-opencl
133141
142+
- name: Install Intel GPU driver
143+
if: ${{ inputs.install_igc_driver && (inputs.adapter_name == 'OPENCL' || contains(inputs.adapter_name,'L0')) }}
144+
env:
145+
GITHUB_TOKEN: ${{ github.token }}
146+
run: |
147+
sudo -E bash devops/scripts/install_drivers.sh devops/dependencies.json --igfx
148+
134149
- name: Configure Unified Runtime project
135150
# ">" is used to avoid adding "\" at the end of each line; this command is quite long
136151
run: >

.github/workflows/ur-precommit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
other_adapter_name: ${{ matrix.other_adapter || '' }}
9999
docker_image: ${{ matrix.docker_image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}}
100100
image_options: ${{ matrix.image_options || '' }}
101+
install_igc_driver: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
101102

102103
# TODO: Enable once the apt package at https://apt.llvm.org/noble/pool/main/l/llvm-toolchain-snapshot/ is updated
103104
# offload_build:

buildbot/compile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ def do_compile(args):
3131
"cmake",
3232
"--build",
3333
abs_obj_dir,
34+
]
35+
36+
if args.verbose:
37+
cmake_cmd.append("--verbose")
38+
39+
cmake_cmd += [
3440
"--",
3541
args.build_target,
3642
"-j",
3743
str(cpu_count),
3844
]
3945

40-
if args.verbose:
41-
cmake_cmd.append("--verbose")
42-
4346
print("[Cmake Command]: {}".format(" ".join(cmake_cmd)))
4447

4548
subprocess.check_call(cmake_cmd, cwd=abs_obj_dir)

buildbot/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def do_configure(args, passthrough_args):
2121
if not os.path.isdir(abs_obj_dir):
2222
os.makedirs(abs_obj_dir)
2323

24-
llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw"
24+
llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw;compiler-rt"
2525

2626
# libdevice build requires a working SYCL toolchain, which is not the case
2727
# with macOS target right now.

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
12131213
PB.registerPipelineStartEPCallback(
12141214
[Options](ModulePassManager &MPM, OptimizationLevel Level) {
12151215
MPM.addPass(InstrProfilingLoweringPass(*Options, false));
1216+
// The profiling pass adds SYCL device globals so we need to run
1217+
// the compile-time properties pass to update the metadata.
1218+
MPM.addPass(CompileTimePropertiesPass());
12161219
});
12171220

12181221
// TODO: Consider passing the MemoryProfileOutput to the pass builder via

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5423,6 +5423,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54235423
CmdArgs.push_back("-fsycl-is-device");
54245424
CmdArgs.push_back("-fdeclare-spirv-builtins");
54255425

5426+
// Set the atomic profile update flag to increment counters atomically.
5427+
CmdArgs.push_back("-fprofile-update=atomic");
5428+
54265429
// Set O2 optimization level by default
54275430
if (!Args.getLastArg(options::OPT_O_Group))
54285431
CmdArgs.push_back("-O2");
@@ -10023,6 +10026,26 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1002310026
// object that is fed to the linker from the wrapper generated bc file
1002410027
assert(isa<OffloadWrapperJobAction>(JA) && "Expecting wrapping job!");
1002510028

10029+
// Validate and propogate CLI options related to device image compression
10030+
// and enabling preview breaking changes.
10031+
auto addCLIOptions = [&](ArgStringList &Args) -> void {
10032+
// -offload-compress
10033+
if (C.getInputArgs().hasFlag(options::OPT_offload_compress,
10034+
options::OPT_no_offload_compress, false)) {
10035+
Args.push_back(C.getArgs().MakeArgString(Twine("-offload-compress")));
10036+
// -offload-compression-level=<>
10037+
if (Arg *A = C.getInputArgs().getLastArg(
10038+
options::OPT_offload_compression_level_EQ))
10039+
Args.push_back(C.getArgs().MakeArgString(
10040+
Twine("-offload-compression-level=") + A->getValue()));
10041+
}
10042+
// Enable preview breaking changes in clang-offload-wrapper,
10043+
// in case it needs to introduce any ABI breaking changes.
10044+
// For example, changes in offload binary descriptor format.
10045+
if (C.getArgs().hasArg(options::OPT_fpreview_breaking_changes))
10046+
Args.push_back("-fpreview-breaking-changes");
10047+
};
10048+
1002610049
Action::OffloadKind OffloadingKind = JA.getOffloadingDeviceKind();
1002710050
if (OffloadingKind == Action::OFK_SYCL) {
1002810051
// The wrapper command looks like this:
@@ -10054,18 +10077,7 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1005410077
llvm::Triple TT = getToolChain().getTriple();
1005510078
SmallString<128> TargetTripleOpt = TT.getArchName();
1005610079

10057-
// Validate and propogate CLI options related to device image compression.
10058-
// -offload-compress
10059-
if (C.getInputArgs().getLastArg(options::OPT_offload_compress)) {
10060-
WrapperArgs.push_back(
10061-
C.getArgs().MakeArgString(Twine("-offload-compress")));
10062-
// -offload-compression-level=<>
10063-
if (Arg *A = C.getInputArgs().getLastArg(
10064-
options::OPT_offload_compression_level_EQ))
10065-
WrapperArgs.push_back(C.getArgs().MakeArgString(
10066-
Twine("-offload-compression-level=") + A->getValue()));
10067-
}
10068-
10080+
addCLIOptions(WrapperArgs);
1006910081
addRunTimeWrapperOpts(C, OffloadingKind, TCArgs, WrapperArgs,
1007010082
getToolChain(), JA);
1007110083

@@ -10095,12 +10107,6 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1009510107
WrapperArgs.push_back(
1009610108
C.getArgs().MakeArgString(Twine("-kind=") + Twine(Kind)));
1009710109

10098-
// Enable preview breaking changes in clang-offload-wrapper,
10099-
// in case it needs to introduce any ABI breaking changes.
10100-
// For example, changes in offload binary descriptor format.
10101-
if (C.getArgs().hasArg(options::OPT_fpreview_breaking_changes))
10102-
WrapperArgs.push_back("-fpreview-breaking-changes");
10103-
1010410110
assert((Inputs.size() > 0) && "no inputs for clang-offload-wrapper");
1010510111
assert(((Inputs[0].getType() != types::TY_Tempfiletable) ||
1010610112
(Inputs.size() == 1)) &&
@@ -10168,19 +10174,8 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1016810174
"Not have inputs for all dependence actions??");
1016910175

1017010176
if (OffloadingKind == Action::OFK_None &&
10171-
C.getArgs().hasArg(options::OPT_fsycl_link_EQ)) {
10172-
10173-
// When compiling and linking separately, we need to propagate the
10174-
// compression related CLI options to offload-wrapper.
10175-
if (C.getInputArgs().getLastArg(options::OPT_offload_compress)) {
10176-
CmdArgs.push_back(C.getArgs().MakeArgString(Twine("-offload-compress")));
10177-
// -offload-compression-level=<>
10178-
if (Arg *A = C.getInputArgs().getLastArg(
10179-
options::OPT_offload_compression_level_EQ))
10180-
CmdArgs.push_back(C.getArgs().MakeArgString(
10181-
Twine("-offload-compression-level=") + A->getValue()));
10182-
}
10183-
}
10177+
C.getArgs().hasArg(options::OPT_fsycl_link_EQ))
10178+
addCLIOptions(CmdArgs);
1018410179

1018510180
// Add offload targets and inputs.
1018610181
for (unsigned I = 0; I < Inputs.size(); ++I) {

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,10 @@ const char *SYCLInstallationDetector::findLibspirvPath(
6464

6565
const SmallString<64> Basename =
6666
getLibSpirvBasename(DeviceTriple, HostTriple);
67-
auto searchAt = [&](StringRef Path, const Twine &a = "", const Twine &b = "",
68-
const Twine &c = "") -> const char * {
69-
SmallString<128> LibraryPath(Path);
70-
llvm::sys::path::append(LibraryPath, a, b, c, Basename);
71-
72-
if (D.getVFS().exists(LibraryPath))
73-
return Args.MakeArgString(LibraryPath);
74-
75-
return nullptr;
76-
};
77-
78-
for (const auto &IC : InstallationCandidates) {
79-
// Expected path w/out install.
80-
if (const char *R = searchAt(IC, "lib", "clc"))
81-
return R;
82-
83-
// Expected path w/ install.
84-
if (const char *R = searchAt(IC, "share", "clc"))
85-
return R;
86-
}
67+
SmallString<256> LibclcPath(D.ResourceDir);
68+
llvm::sys::path::append(LibclcPath, "lib", "libclc", Basename);
69+
if (D.getVFS().exists(LibclcPath))
70+
return Args.MakeArgString(LibclcPath);
8771

8872
return nullptr;
8973
}
@@ -1387,11 +1371,7 @@ static ArrayRef<options::ID> getUnsupportedOpts() {
13871371
options::OPT_fno_profile_generate, // -f[no-]profile-generate
13881372
options::OPT_ftest_coverage,
13891373
options::OPT_fno_test_coverage, // -f[no-]test-coverage
1390-
options::OPT_fcoverage_mapping,
1391-
options::OPT_coverage, // --coverage
1392-
options::OPT_fno_coverage_mapping, // -f[no-]coverage-mapping
1393-
options::OPT_fprofile_instr_generate,
1394-
options::OPT_fprofile_instr_generate_EQ,
1374+
options::OPT_coverage, // --coverage
13951375
options::OPT_fprofile_arcs,
13961376
options::OPT_fno_profile_arcs, // -f[no-]profile-arcs
13971377
options::OPT_fno_profile_instr_generate, // -f[no-]profile-instr-generate

clang/test/Driver/Inputs/SYCL/bin/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)