Skip to content

Commit 6e4f663

Browse files
committed
Merge remote-tracking branch 'intel_llvm/sycl-web' into llvmspirv_pulldown
2 parents faa9b2c + 6241a64 commit 6e4f663

File tree

982 files changed

+124254
-23647
lines changed

Some content is hidden

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

982 files changed

+124254
-23647
lines changed

.github/workflows/linux_single_e2e.yml

+39-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
required: True
1616
image_options:
1717
type: string
18-
required: False
18+
required: True
1919

2020
target_devices:
2121
type: string
@@ -59,6 +59,43 @@ on:
5959
default: '{}'
6060
required: False
6161

62+
workflow_dispatch:
63+
inputs:
64+
runner:
65+
type: choice
66+
options:
67+
- '["Linux", "gen12"]'
68+
- '["amdgpu"]'
69+
image:
70+
description: |
71+
Use option ending with ":build" for AMDGPU, ":latest" for the rest.
72+
type: choice
73+
options:
74+
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:latest'
75+
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build'
76+
image_options:
77+
description: |
78+
Use option with "--device=/dev/kfd" for AMDGPU, without it for the rest.
79+
type: choice
80+
options:
81+
- '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN'
82+
- '-u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN'
83+
target_devices:
84+
type: choice
85+
options:
86+
- 'opencl:cpu'
87+
- 'opencl:gpu'
88+
- 'opencl:acc'
89+
- 'ext_oneapi_level_zero:gpu'
90+
- 'ext_oneapi_hip:gpu'
91+
- 'ext_intel_esimd_emulator:gpu'
92+
93+
env:
94+
description: |
95+
Suggested variables: LIT_FILTER, LIT_FILTER_OUT. LIT_OPTS won't work
96+
as we redefine it as part of this workflow.
97+
default: '{"LIT_FILTER":""}'
98+
6299
jobs:
63100
lin_e2e_only:
64101
name: ${{ inputs.name }}
@@ -83,7 +120,7 @@ jobs:
83120
- uses: ./devops/actions/cached_checkout
84121
with:
85122
path: llvm
86-
ref: ${{ inputs.ref }}
123+
ref: ${{ inputs.ref || github.sha }}
87124
merge_ref: ${{ inputs.merge_ref }}
88125
cache_path: "/__w/repo_cache/"
89126
- name: Install drivers

.github/workflows/sycl_cleanup.yml

-32
This file was deleted.

.github/workflows/sycl_detect_changes.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,9 @@ jobs:
4949
- 'sycl/!(test-e2e|doc)/**'
5050
ci:
5151
- .github/workflows/**
52-
- devops/*/**
5352
# devops/* contains config files, including drivers versions.
5453
# Allow them to be tested in pre-commit.
55-
drivers_and_configs: &drivers_and_configs
56-
- devops/*
57-
test_build:
58-
- *sycl
59-
- *drivers_and_configs
60-
# Temporary, until plugins are enabled in nightly image.
61-
- sycl/**
54+
- devops/*/**
6255
6356
- name: Set output
6457
id: result
@@ -71,6 +64,6 @@ jobs:
7164
return '${{ steps.changes.outputs.changes }}';
7265
}
7366
// Treat everything as changed for huge PRs.
74-
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci", "drivers_and_configs", "test_build"];
67+
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci"];
7568
7669
- run: echo '${{ steps.result.outputs.result }}'

.github/workflows/sycl_linux_build_and_test.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ on:
7373
type: string
7474
required: false
7575
default: 'SYCL-2020'
76-
check_filters:
76+
changes:
7777
type: string
7878
description: 'Filter matches for the changed files in the PR'
7979
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
@@ -136,35 +136,35 @@ jobs:
136136
id: build
137137
run: cmake --build $GITHUB_WORKSPACE/build
138138
- name: check-llvm
139-
if: always() && !cancelled() && contains(inputs.check_filters, 'llvm')
139+
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
140140
run: |
141141
cmake --build $GITHUB_WORKSPACE/build --target check-llvm
142142
- name: check-clang
143-
if: always() && !cancelled() && contains(inputs.check_filters, 'clang')
143+
if: always() && !cancelled() && contains(inputs.changes, 'clang')
144144
run: |
145145
# Can we move this to Dockerfile? Hopefully, noop on Windows.
146146
export XDG_CACHE_HOME=$GITHUB_WORKSPACE/os_cache
147147
cmake --build $GITHUB_WORKSPACE/build --target check-clang
148148
- name: check-sycl
149-
if: always() && !cancelled() && contains(inputs.check_filters, 'sycl')
149+
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
150150
run: |
151151
# TODO consider moving this to Dockerfile.
152152
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
153153
cmake --build $GITHUB_WORKSPACE/build --target check-sycl
154154
- name: check-llvm-spirv
155-
if: always() && !cancelled() && contains(inputs.check_filters, 'llvm_spirv')
155+
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
156156
run: |
157157
cmake --build $GITHUB_WORKSPACE/build --target check-llvm-spirv
158158
- name: check-xptifw
159-
if: always() && !cancelled() && contains(inputs.check_filters, 'xptifw')
159+
if: always() && !cancelled() && contains(inputs.changes, 'xptifw')
160160
run: |
161161
cmake --build $GITHUB_WORKSPACE/build --target check-xptifw
162162
- name: check-libclc
163-
if: always() && !cancelled() && contains(inputs.check_filters, 'libclc')
163+
if: always() && !cancelled() && contains(inputs.changes, 'libclc')
164164
run: |
165165
cmake --build $GITHUB_WORKSPACE/build --target check-libclc
166166
- name: check-libdevice
167-
if: always() && !cancelled() && contains(inputs.check_filters, 'libdevice')
167+
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
168168
run: |
169169
cmake --build $GITHUB_WORKSPACE/build --target check-libdevice
170170
- name: Install

.github/workflows/sycl_linux_gen12_exp.yml

-23
This file was deleted.

.github/workflows/sycl_nightly.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ jobs:
1111
name: Generate Test Matrix
1212
uses: ./.github/workflows/sycl_gen_test_matrix.yml
1313
with:
14-
# Restore once plugins are enabled in the build.
15-
# lts_config: "hip_amdgpu;ocl_gen12;ocl_x64;l0_gen12;esimd_emu;cuda_aws;win_l0_gen12"
16-
lts_config: "ocl_gen12;ocl_x64;l0_gen12;win_l0_gen12"
14+
lts_config: "hip_amdgpu;ocl_gen12;ocl_x64;l0_gen12;esimd_emu;cuda_aws;win_l0_gen12"
1715

1816
ubuntu2204_build_test:
1917
if: github.repository == 'intel/llvm'
@@ -23,11 +21,11 @@ jobs:
2321
with:
2422
build_cache_root: "/__w/"
2523
build_artifact_suffix: default-2204
24+
build_configure_extra_args: '--hip --cuda --enable-esimd-emulator'
2625
merge_ref: ''
2726
retention-days: 90
2827
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
2928
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
30-
build_configure_extra_args: ''
3129

3230
ubuntu2204_opaque_pointers_build_test:
3331
if: github.repository == 'intel/llvm'
@@ -63,7 +61,7 @@ jobs:
6361
- name: Build and Push Container (with drivers)
6462
uses: ./devops/actions/build_container
6563
with:
66-
push: ${{ github.event_name != 'pull_request' }}
64+
push: ${{ github.ref_name == 'sycl' }}
6765
file: ubuntu2204_preinstalled
6866
username: ${{ github.repository_owner }}
6967
password: ${{ secrets.GITHUB_TOKEN }}
@@ -76,7 +74,7 @@ jobs:
7674
- name: Build and Push Container (no drivers)
7775
uses: ./devops/actions/build_container
7876
with:
79-
push: ${{ github.event_name != 'pull_request' }}
77+
push: ${{ github.ref_name == 'sycl' }}
8078
file: ubuntu2204_preinstalled
8179
username: ${{ github.repository_owner }}
8280
password: ${{ secrets.GITHUB_TOKEN }}
@@ -89,7 +87,7 @@ jobs:
8987
- name: Build and Push Container (Build image)
9088
uses: ./devops/actions/build_container
9189
with:
92-
push: ${{ github.event_name != 'pull_request' }}
90+
push: ${{ github.ref_name == 'sycl' }}
9391
file: ubuntu2204_preinstalled
9492
username: ${{ github.repository_owner }}
9593
password: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sycl_precommit_linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ jobs:
9292
build_cache_suffix: "default"
9393
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
9494
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
95-
check_filters: ${{ needs.detect_changes.outputs.filters }}
95+
changes: ${{ needs.detect_changes.outputs.filters }}

.github/workflows/sycl_precommit_windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ jobs:
8484
with:
8585
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}
8686
build_ref: ${{ github.event.pull_request.head.sha }}
87-
check_filters: ${{ needs.detect_changes.outputs.filters }}
87+
changes: ${{ needs.detect_changes.outputs.filters }}

.github/workflows/sycl_windows_build_and_test.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
type: string
1919
required: false
2020
default: ""
21-
check_filters:
21+
changes:
2222
type: string
2323
description: 'Filter matches for the changed files in the PR'
2424
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
@@ -77,27 +77,27 @@ jobs:
7777
run: |
7878
cmake --build build --target sycl-toolchain
7979
- name: check-llvm
80-
if: always() && !cancelled() && contains(inputs.check_filters, 'llvm')
80+
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
8181
run: |
8282
cmake --build build --target check-llvm
8383
- name: check-clang
84-
if: always() && !cancelled() && contains(inputs.check_filters, 'clang')
84+
if: always() && !cancelled() && contains(inputs.changes, 'clang')
8585
run: |
8686
cmake --build build --target check-clang
8787
- name: check-sycl
88-
if: always() && !cancelled() && contains(inputs.check_filters, 'sycl')
88+
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
8989
run: |
9090
cmake --build build --target check-sycl
9191
- name: check-llvm-spirv
92-
if: always() && !cancelled() && contains(inputs.check_filters, 'llvm_spirv')
92+
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
9393
run: |
9494
cmake --build build --target check-llvm-spirv
9595
- name: check-xptifw
96-
if: always() && !cancelled() && contains(inputs.check_filters, 'xptifw')
96+
if: always() && !cancelled() && contains(inputs.changes, 'xptifw')
9797
run: |
9898
cmake --build build --target check-xptifw
9999
- name: check-libdevice
100-
if: always() && !cancelled() && contains(inputs.check_filters, 'libdevice')
100+
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
101101
run: |
102102
cmake --build build --target check-libdevice
103103
- name: Install

bolt/include/bolt/Core/BinaryFunction.h

+9
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ class BinaryFunction {
339339
bool HasPseudoProbe{BC.getUniqueSectionByName(".pseudo_probe_desc") &&
340340
BC.getUniqueSectionByName(".pseudo_probe")};
341341

342+
/// True if the function uses ORC format for stack unwinding.
343+
bool HasORC{false};
344+
342345
/// True if the original entry point was patched.
343346
bool IsPatched{false};
344347

@@ -1340,6 +1343,9 @@ class BinaryFunction {
13401343
/// Return true if the function has Pseudo Probe
13411344
bool hasPseudoProbe() const { return HasPseudoProbe; }
13421345

1346+
/// Return true if the function uses ORC format for stack unwinding.
1347+
bool hasORC() const { return HasORC; }
1348+
13431349
/// Return true if the original entry point was patched.
13441350
bool isPatched() const { return IsPatched; }
13451351

@@ -1704,6 +1710,9 @@ class BinaryFunction {
17041710

17051711
void setHasSDTMarker(bool V) { HasSDTMarker = V; }
17061712

1713+
/// Mark the function as using ORC format for stack unwinding.
1714+
void setHasORC(bool V) { HasORC = V; }
1715+
17071716
BinaryFunction &setPersonalityFunction(uint64_t Addr) {
17081717
assert(!PersonalityFunction && "can't set personality function twice");
17091718
PersonalityFunction = BC.getOrCreateGlobalSymbol(Addr, "FUNCat");

bolt/include/bolt/Rewrite/MetadataManager.h

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class MetadataManager {
3333
/// CFG is not yet built.
3434
void runInitializersPreCFG();
3535

36+
/// Execute metadata initializers after CFG was constructed for functions.
37+
void runInitializersPostCFG();
38+
3639
/// Run finalization step of rewriters after code has been emitted.
3740
void runFinalizersAfterEmit();
3841
};

bolt/include/bolt/Rewrite/MetadataRewriter.h

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class MetadataRewriter {
4949
/// contents of the section. Functions are in pre-cfg state.
5050
virtual Error preCFGInitializer() { return Error::success(); }
5151

52+
/// Run the rewriter once the functions are in CFG state.
53+
virtual Error postCFGInitializer() { return Error::success(); }
54+
5255
/// Finalize section contents based on the new context after the new code is
5356
/// emitted.
5457
virtual Error postEmitFinalizer() { return Error::success(); }

bolt/include/bolt/Rewrite/RewriteInstance.h

+3
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ class RewriteInstance {
171171
/// Process metadata in special sections before CFG is built for functions.
172172
void processMetadataPreCFG();
173173

174+
/// Process metadata in special sections after CFG is built for functions.
175+
void processMetadataPostCFG();
176+
174177
/// Update debug and other auxiliary information in the file.
175178
void updateMetadata();
176179

bolt/lib/Core/DIEBuilder.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ DIE *DIEBuilder::constructDIEFast(DWARFDie &DDie, DWARFUnit &U,
290290
DIEInfo &DieInfo = getDIEInfo(UnitId, *Idx);
291291

292292
uint64_t Offset = DDie.getOffset();
293+
// Just for making debugging easier.
294+
// DIE dump is not very useful.
295+
// It's nice to know original offset from which this DIE was constructed.
296+
DieInfo.Die->setOffset(Offset);
293297
uint64_t NextOffset = Offset;
294298
DWARFDataExtractor Data = U.getDebugInfoExtractor();
295299
DWARFDebugInfoEntry DDIEntry;

bolt/lib/Rewrite/DWARFRewriter.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ void DWARFRewriter::updateDWARFObjectAddressRanges(
12051205

12061206
// If we are at this point we are in the CU/Skeleton CU, and
12071207
// DW_AT_GNU_ranges_base or DW_AT_rnglists_base doesn't exist.
1208-
if (Unit.getVersion() < 4)
1208+
if (Unit.getVersion() <= 4)
12091209
DIEBldr.addValue(&Die, dwarf::DW_AT_GNU_ranges_base, dwarf::DW_FORM_data4,
12101210
DIEInteger(*RangesBase));
12111211
else if (Unit.getVersion() == 5)
@@ -1225,9 +1225,10 @@ void DWARFRewriter::updateDWARFObjectAddressRanges(
12251225
convertToRangesPatchDebugInfo(Unit, DIEBldr, Die, DebugRangesOffset,
12261226
LowPCAttrInfo, HighPCAttrInfo, LowPCToUse,
12271227
RangesBase);
1228-
} else {
1228+
} else if (!(Unit.isDWOUnit() &&
1229+
Die.getTag() == dwarf::DW_TAG_compile_unit)) {
12291230
if (opts::Verbosity >= 1)
1230-
errs() << "BOLT-ERROR: cannot update ranges for DIE in Unit offset 0x"
1231+
errs() << "BOLT-WARNING: cannot update ranges for DIE in Unit offset 0x"
12311232
<< Unit.getOffset() << '\n';
12321233
}
12331234
}

0 commit comments

Comments
 (0)