Skip to content

Commit b36583e

Browse files
author
kbobrovs
committed
Merge remote-tracking branch 'intel/sycl' into dyn_slm_alloc
2 parents 0310d15 + 177a4f5 commit b36583e

File tree

7,355 files changed

+193970
-77414
lines changed

Some content is hidden

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

7,355 files changed

+193970
-77414
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ jobs:
195195

196196
llvm_test_suite:
197197
needs: [build, aws-start]
198-
if: ${{ !failure() && inputs.lts_matrix != '[]' }}
198+
# Continue if build was successful. If aws-start is not successful all
199+
# AWS tasks will fail, but all non-AWS tasks should continue.
200+
if: ${{ always() && needs.build.result == 'success' && inputs.lts_matrix != '[]' }}
199201
strategy:
200202
fail-fast: false
201203
max-parallel: ${{ inputs.max_parallel }}
@@ -242,7 +244,7 @@ jobs:
242244
check_sycl_all: ${{ matrix.check_sycl_all }}
243245
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
244246
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
245-
247+
246248
khronos_sycl_cts:
247249
needs: build
248250
if: ${{ inputs.cts_matrix != '' }}
@@ -293,6 +295,8 @@ jobs:
293295
aws-stop:
294296
name: Stop AWS
295297
needs: [ aws-start, llvm_test_suite ]
298+
# Always attempt to shutdown AWS instance, even if AWS start was not
299+
# successful.
296300
if: ${{ always() && inputs.lts_aws_matrix != '[]' }}
297301
runs-on: ubuntu-latest
298302
environment: aws

.github/workflows/sycl_post_commit.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ jobs:
6565
- name: Configure
6666
run: |
6767
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
68-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
68+
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
6969
sudo apt-get update
70-
sudo apt-get install -y clang-13
71-
export CC="clang-13"
72-
export CXX="clang++-13"
70+
sudo apt-get install -y clang-15
71+
export CC="clang-15"
72+
export CXX="clang++-15"
7373
mkdir -p $GITHUB_WORKSPACE/build
7474
cd $GITHUB_WORKSPACE/build
7575
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \

.github/workflows/sycl_precommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: ./.github/workflows/sycl_gen_test_matrix.yml
4949
with:
5050
ref: ${{ github.event.pull_request.head.sha }}
51-
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu;cuda"
51+
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu;cuda_aws"
5252

5353
linux_default:
5454
name: Linux

.github/workflows/sycl_windows_build_and_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
type: string
88
required: false
99
default: "default"
10+
build_ref:
11+
type: string
12+
required: false
1013

1114
jobs:
1215
build:
@@ -26,6 +29,7 @@ jobs:
2629
- uses: actions/checkout@v3
2730
with:
2831
path: src
32+
ref: ${{ inputs.build_ref || github.ref }}
2933
fetch-depth: 1
3034
- name: Register cleanup after job is finished
3135
uses: ./src/devops/actions/cleanup
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Test windows on the comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
windows_test_preparation:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/start Windows testing' }}
11+
steps:
12+
- name: react_to_comment
13+
uses: actions/github-script@v4
14+
with:
15+
script: |
16+
const {owner, repo} = context.issue;
17+
github.reactions.createForIssueComment({
18+
owner,
19+
repo,
20+
comment_id: context.payload.comment.id,
21+
content: "rocket",
22+
});
23+
- name: get_pr_sha
24+
id: sha
25+
uses: actions/github-script@v4
26+
with:
27+
result-encoding: string
28+
script: |
29+
const { owner, repo, number } = context.issue;
30+
const pr = await github.pulls.get({
31+
owner,
32+
repo,
33+
pull_number: number,
34+
});
35+
return pr.data.head.sha
36+
- name: update_pr_status_pending
37+
run: |
38+
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='pending' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='The build started2!' -f context='Windows pre-commit'
39+
echo "REF == = = = = = = ${{ steps.sha.outputs.result }}"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
OWNER: ${{ github.repository_owner }}
43+
REPO: ${{ github.event.repository.name }}
44+
SHA: ${{ steps.sha.outputs.result }}
45+
outputs:
46+
PR_SHA: ${{ steps.sha.outputs.result }}
47+
48+
49+
windows_default:
50+
name: Windows
51+
needs: [windows_test_preparation]
52+
if: github.repository == 'intel/llvm'
53+
uses: ./.github/workflows/sycl_windows_build_and_test.yml
54+
with:
55+
build_ref: ${{ needs.windows_test_preparation.outputs.PR_SHA }}
56+
57+
windows_test_completion:
58+
runs-on: ubuntu-latest
59+
needs: [windows_default]
60+
steps:
61+
- name: update_pr_status_success
62+
if: always() && success()
63+
run: |
64+
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='success' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='The build started2!' -f context='Windows pre-commit'
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
OWNER: ${{ github.repository_owner }}
68+
REPO: ${{ github.event.repository.name }}
69+
SHA: ${{ steps.sha.outputs.result }}
70+
- name: update_pr_status_failure
71+
if: failure()
72+
run: |
73+
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='failure' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='The build started2!' -f context='Windows pre-commit'
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
OWNER: ${{ github.repository_owner }}
77+
REPO: ${{ github.event.repository.name }}
78+
SHA: ${{ steps.sha.outputs.result }}
79+
80+
# windows_default:
81+
# runs-on: ubuntu-latest
82+
# needs: [windows_test_preparation]
83+
# steps:
84+
# - name: print_ref
85+
# run: |
86+
# echo "REF == = = = = = = ${{github.ref}}"
87+
# echo "REF == = = = = = = ${{ needs.windows_test_preparation.outputs.PR_SHA }}"

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ approved by an Intel representative.
8181
- A new approval is needed if the PR was updated (e.g. during code review).
8282
- Once the PR is approved and all checks have passed, the pull request is
8383
ready for merge.
84+
- Sometimes unrelated fails can be observed in the PR. It's author
85+
responsibility to find/guess the reason of these fails and post a comment in
86+
the PR with:
87+
- possible reason of fails, ideally with a link to the PR, which caused fails
88+
- link to other PR(s), which expected to fix fails
89+
- person who is currently looking into fails
90+
- link to existing open issue
91+
- if author cannot identify any of these, the minimal action expected is to
92+
open a new [issue](/../../issues)
8493
8594
### Merge
8695
@@ -89,7 +98,8 @@ and merge] and using PR description as the commit message, replacing all
8998
individual comments made per commit. Authors of the change must ensure PR
9099
description is up to date at the merge stage, as sometimes comments addressed
91100
during code reviews can invalidate original PR description. Feel free to ping
92-
@intel/llvm-gatekeepers if your PR is green and can be merged.
101+
@intel/llvm-gatekeepers if your PR is green and can be merged. Note that
102+
gatekeepers will require explanation for any failures observed.
93103
94104
Pulldown from LLVM upstream is done through merge commits to preserve hashes of
95105
the original commits pulled from the LLVM community repository.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Intel LLVM-based projects:
66
- [oneAPI DPC++ compiler](#oneapi-dpc-compiler)
77
- [Late-outline OpenMP and OpenMP Offload](#late-outline-openmp-and-openmp-offload)
88

9+
For general contribution process see [CONTRIBUTING.md](./CONTRIBUTING.md)
10+
911
## oneAPI DPC++ compiler
1012

1113
[![](https://spec.oneapi.io/oneapi-logo-white-scaled.jpg)](https://www.oneapi.io/)

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class BinaryContext {
152152
std::string Filename;
153153

154154
/// Unique build ID if available for the binary.
155-
Optional<std::string> FileBuildID;
155+
std::optional<std::string> FileBuildID;
156156

157157
/// Set of all sections.
158158
struct CompareSections {
@@ -259,7 +259,7 @@ class BinaryContext {
259259
void clearFragmentsToSkip() { FragmentsToSkip.clear(); }
260260

261261
/// Given DWOId returns CU if it exists in DWOCUs.
262-
Optional<DWARFUnit *> getDWOCU(uint64_t DWOId);
262+
std::optional<DWARFUnit *> getDWOCU(uint64_t DWOId);
263263

264264
/// Returns DWOContext if it exists.
265265
DWARFContext *getDWOContext() const;
@@ -283,9 +283,9 @@ class BinaryContext {
283283

284284
Expected<unsigned> getDwarfFile(StringRef Directory, StringRef FileName,
285285
unsigned FileNumber,
286-
Optional<MD5::MD5Result> Checksum,
287-
Optional<StringRef> Source, unsigned CUID,
288-
unsigned DWARFVersion);
286+
std::optional<MD5::MD5Result> Checksum,
287+
std::optional<StringRef> Source,
288+
unsigned CUID, unsigned DWARFVersion);
289289

290290
/// [start memory address] -> [segment info] mapping.
291291
std::map<uint64_t, SegmentInfo> SegmentMapInfo;
@@ -319,7 +319,7 @@ class BinaryContext {
319319
StringRef getFilename() const { return Filename; }
320320
void setFilename(StringRef Name) { Filename = std::string(Name); }
321321

322-
Optional<StringRef> getFileBuildID() const {
322+
std::optional<StringRef> getFileBuildID() const {
323323
if (FileBuildID)
324324
return StringRef(*FileBuildID);
325325

@@ -1063,9 +1063,9 @@ class BinaryContext {
10631063
/// segments was mapped. \p FileOffset is the offset in the file of the
10641064
/// mapping. Note that \p FileOffset should be page-aligned and could be
10651065
/// different from the file offset of the segment which could be unaligned.
1066-
/// If no segment is found that matches \p FileOffset, return NoneType().
1067-
Optional<uint64_t> getBaseAddressForMapping(uint64_t MMapAddress,
1068-
uint64_t FileOffset) const;
1066+
/// If no segment is found that matches \p FileOffset, return std::nullopt.
1067+
std::optional<uint64_t> getBaseAddressForMapping(uint64_t MMapAddress,
1068+
uint64_t FileOffset) const;
10691069

10701070
/// Check if the address belongs to this binary's static allocation space.
10711071
bool containsAddress(uint64_t Address) const {

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,8 @@ class BinaryFunction {
894894
BinaryBasicBlock *getLandingPadBBFor(const BinaryBasicBlock &BB,
895895
const MCInst &InvokeInst) const {
896896
assert(BC.MIB->isInvoke(InvokeInst) && "must be invoke instruction");
897-
const Optional<MCPlus::MCLandingPad> LP = BC.MIB->getEHInfo(InvokeInst);
897+
const std::optional<MCPlus::MCLandingPad> LP =
898+
BC.MIB->getEHInfo(InvokeInst);
898899
if (LP && LP->first) {
899900
BinaryBasicBlock *LBB = BB.getLandingPad(LP->first);
900901
assert(LBB && "Landing pad should be defined");
@@ -971,7 +972,7 @@ class BinaryFunction {
971972
/// returns false. Stop if Callback returns true or all names have been used.
972973
/// Return the name for which the Callback returned true if any.
973974
template <typename FType>
974-
Optional<StringRef> forEachName(FType Callback) const {
975+
std::optional<StringRef> forEachName(FType Callback) const {
975976
for (MCSymbol *Symbol : Symbols)
976977
if (Callback(Symbol->getName()))
977978
return Symbol->getName();
@@ -992,11 +993,12 @@ class BinaryFunction {
992993
}
993994

994995
/// Check if any of function names matches the given regex.
995-
Optional<StringRef> hasNameRegex(const StringRef NameRegex) const;
996+
std::optional<StringRef> hasNameRegex(const StringRef NameRegex) const;
996997

997998
/// Check if any of restored function names matches the given regex.
998999
/// Restored name means stripping BOLT-added suffixes like "/1",
999-
Optional<StringRef> hasRestoredNameRegex(const StringRef NameRegex) const;
1000+
std::optional<StringRef>
1001+
hasRestoredNameRegex(const StringRef NameRegex) const;
10001002

10011003
/// Return a vector of all possible names for the function.
10021004
std::vector<StringRef> getNames() const {
@@ -1316,7 +1318,7 @@ class BinaryFunction {
13161318
}
13171319

13181320
/// Return the name of the section this function originated from.
1319-
Optional<StringRef> getOriginSectionName() const {
1321+
std::optional<StringRef> getOriginSectionName() const {
13201322
if (!OriginSection)
13211323
return std::nullopt;
13221324
return OriginSection->getName();

bolt/include/bolt/Core/DebugData.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct AttrInfo {
4646
/// \param DIE die to look up in.
4747
/// \param AbbrevDecl abbrev declaration for the die.
4848
/// \param Index an index in Abbrev declaration entry.
49-
Optional<AttrInfo>
49+
std::optional<AttrInfo>
5050
findAttributeInfo(const DWARFDie DIE,
5151
const DWARFAbbreviationDeclaration *AbbrevDecl,
5252
uint32_t Index);
@@ -56,7 +56,8 @@ findAttributeInfo(const DWARFDie DIE,
5656
/// \param DIE die to look up in.
5757
/// \param Attr the attribute to extract.
5858
/// \return an optional AttrInfo with DWARFFormValue and Offset.
59-
Optional<AttrInfo> findAttributeInfo(const DWARFDie DIE, dwarf::Attribute Attr);
59+
std::optional<AttrInfo> findAttributeInfo(const DWARFDie DIE,
60+
dwarf::Attribute Attr);
6061

6162
// DWARF5 Header in order of encoding.
6263
// Types represent encodnig sizes.
@@ -424,13 +425,13 @@ class DebugStrOffsetsWriter {
424425

425426
/// Initializes Buffer and Stream.
426427
void initialize(const DWARFSection &StrOffsetsSection,
427-
const Optional<StrOffsetsContributionDescriptor> Contr);
428+
const std::optional<StrOffsetsContributionDescriptor> Contr);
428429

429430
/// Update Str offset in .debug_str in .debug_str_offsets.
430431
void updateAddressMap(uint32_t Index, uint32_t Address);
431432

432433
/// Writes out current sections entry into .debug_str_offsets.
433-
void finalizeSection();
434+
void finalizeSection(DWARFUnit &Unit);
434435

435436
/// Returns False if no strings were added to .debug_str.
436437
bool isFinalized() const { return !StrOffsetsBuffer->empty(); }
@@ -444,8 +445,10 @@ class DebugStrOffsetsWriter {
444445
std::unique_ptr<DebugStrOffsetsBufferVector> StrOffsetsBuffer;
445446
std::unique_ptr<raw_svector_ostream> StrOffsetsStream;
446447
std::map<uint32_t, uint32_t> IndexToAddressMap;
448+
DenseSet<uint64_t> ProcessedBaseOffsets;
447449
// Section size not including header.
448450
uint32_t CurrentSectionSize{0};
451+
bool StrOffsetSectionWasModified = false;
449452
};
450453

451454
using DebugStrBufferVector = SmallVector<char, 16>;
@@ -1130,11 +1133,11 @@ class DwarfLineTable {
11301133

11311134
/// Emit the Dwarf file and the line tables for a given CU.
11321135
void emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params,
1133-
Optional<MCDwarfLineStr> &LineStr, BinaryContext &BC) const;
1136+
std::optional<MCDwarfLineStr> &LineStr, BinaryContext &BC) const;
11341137

11351138
Expected<unsigned> tryGetFile(StringRef &Directory, StringRef &FileName,
1136-
Optional<MD5::MD5Result> Checksum,
1137-
Optional<StringRef> Source,
1139+
std::optional<MD5::MD5Result> Checksum,
1140+
std::optional<StringRef> Source,
11381141
uint16_t DwarfVersion,
11391142
unsigned FileNumber = 0) {
11401143
assert(RawData.empty() && "cannot use with raw data");
@@ -1150,8 +1153,8 @@ class DwarfLineTable {
11501153
/// Sets the root file \p Directory, \p FileName, optional \p CheckSum, and
11511154
/// optional \p Source.
11521155
void setRootFile(StringRef Directory, StringRef FileName,
1153-
Optional<MD5::MD5Result> Checksum,
1154-
Optional<StringRef> Source) {
1156+
std::optional<MD5::MD5Result> Checksum,
1157+
std::optional<StringRef> Source) {
11551158
Header.setRootFile(Directory, FileName, Checksum, Source);
11561159
}
11571160

0 commit comments

Comments
 (0)