Skip to content

Commit 3f6b592

Browse files
author
aidan.belton
committed
Merge remote-tracking branch 'origin/sycl' into aspect_bf16
2 parents 1f1c8c8 + f0df89a commit 3f6b592

File tree

8,708 files changed

+390544
-128410
lines changed

Some content is hidden

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

8,708 files changed

+390544
-128410
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ opencl/ @intel/llvm-reviewers-runtime
1818
# OpenCL "offline" compiler
1919
opencl/opencl-aot/ @intel/dpcpp-tools-reviewers
2020

21+
# libclc library
22+
libclc/ @intel/llvm-reviewers-cuda
23+
2124
# Device library
2225
libdevice/ @intel/llvm-reviewers-runtime
2326

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ on:
5252
type: string
5353
required: false
5454
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
55+
cuda_image:
56+
type: string
57+
required: false
58+
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
5559
lts_ref:
5660
type: string
5761
required: false

.github/workflows/sycl_nightly.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,3 @@ jobs:
6060
tags: |
6161
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers-${{ github.sha }}
6262
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers
63-
ubuntu2004_build_test_new_pm:
64-
# Default Linux building and LIT testing using new Pass Manager by default
65-
if: github.repository == 'intel/llvm'
66-
uses: ./.github/workflows/sycl_linux_build_and_test.yml
67-
with:
68-
build_cache_root: "/__w/"
69-
build_cache_suffix: new_pm
70-
build_artifact_suffix: new_pm
71-
build_configure_extra_args: '--hip --cuda --cmake-opt=-DLLVM_ENABLE_NEW_PASS_MANAGER=ON'
72-
lts_config: "hip_amdgpu;ocl_x64"

.github/workflows/sycl_precommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
build_cache_size: "8G"
4242
build_artifact_suffix: "default"
4343
build_cache_suffix: "default"
44-
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu"
44+
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu;cuda"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update GPU driver
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 2'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update_driver_linux:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'intel/llvm'
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Update dependencies file
15+
run: |
16+
version="$(python3 devops/scripts/update_drivers.py linux)"
17+
echo 'NEW_DRIVER_VERSION='$version >> $GITHUB_ENV
18+
- name: Create Pull Request
19+
env:
20+
BRANCH: ci/update_gpu_driver-linux-${{ env.NEW_DRIVER_VERSION }}
21+
LLVMBOT_TOKEN: ${{ secrets.LLVM_MAIN_SYNC_BBSYCL_TOKEN }}
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: |
24+
cd $GITHUB_WORKSPACE
25+
# Set fake identity to fulfil git requirements
26+
git config --global user.name "GitHub Actions"
27+
git config --global user.email "[email protected]"
28+
git checkout -B $BRANCH
29+
git add -u
30+
git commit -m "[GHA] Uplift GPU RT version for Linux CI" || exit 0 # exit if commit is empty
31+
git push https://[email protected]/${{ github.repository }} ${BRANCH}
32+
gh pr create --head $BRANCH --title "[GHA] Uplift GPU RT version for Linux CI" --body "Uplift GPU RT version for Linux to $NEW_DRIVER_VERSION"
33+
34+
update_driver_linux_staging:
35+
runs-on: ubuntu-latest
36+
if: github.repository == 'intel/llvm'
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Update dependencies file
40+
run: |
41+
version="$(python3 devops/scripts/update_drivers.py linux_staging)"
42+
echo 'NEW_DRIVER_VERSION='$version >> $GITHUB_ENV
43+
- name: Update sycl Branch
44+
env:
45+
BRANCH: ci/update_gpu_driver-linux_staging-${{ env.NEW_DRIVER_VERSION }}
46+
LLVMBOT_TOKEN: ${{ secrets.LLVM_MAIN_SYNC_BBSYCL_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
cd $GITHUB_WORKSPACE
50+
# Set fake identity to fulfil git requirements
51+
git config --global user.name "GitHub Actions"
52+
git config --global user.email "[email protected]"
53+
git checkout -B $BRANCH
54+
git add -u
55+
git commit -m "[GHA] Uplift GPU RT version for Nightly Builds" || exit 0 # exit if commit is empty
56+
git push https://[email protected]/${{ github.repository }} ${BRANCH}
57+
gh pr create --head $BRANCH --title "[GHA] Uplift GPU RT version for Nightly Builds" --body "Uplift GPU RT version for Linux to $NEW_DRIVER_VERSION"
58+

.github/workflows/sycl_windows_build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
3939
IF NOT EXIST D:\github\_work\cache\sycl_${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
4040
python.exe src/buildbot/configure.py -o build ^
41-
--ci-default ^
41+
--ci-defaults ^
4242
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
4343
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
4444
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^

bolt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Once you have `perf.fdata` ready, you can use it for optimizations with
180180
BOLT. Assuming your environment is setup to include the right path, execute
181181
`llvm-bolt`:
182182
```
183-
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=cache+ -reorder-functions=hfsort -split-functions=2 -split-all-cold -split-eh -dyno-stats
183+
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions=2 -split-all-cold -split-eh -dyno-stats
184184
```
185185

186186
If you do need an updated debug info, then add `-update-debug-sections` option

bolt/docs/OptimizingClang.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Notice that we are passing `clang-7` to `perf2bolt` which is the real binary tha
6464
the generated profile:
6565
```bash
6666
$ llvm-bolt $CPATH/clang-7 -o $CPATH/clang-7.bolt -b clang-7.yaml \
67-
-reorder-blocks=cache+ -reorder-functions=hfsort+ -split-functions=3 \
67+
-reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions=3 \
6868
-split-all-cold -dyno-stats -icf=1 -use-gnu-stack
6969
```
7070
The output will look similar to the one below:

bolt/docs/doxygen.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "BOLT"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER =
41+
PROJECT_NUMBER = @PACKAGE_VERSION@
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ inline raw_ostream &operator<<(raw_ostream &OS, const SegmentInfo &SegInfo) {
8282
return OS;
8383
}
8484

85+
// AArch64-specific symbol markers used to delimit code/data in .text.
86+
enum class MarkerSymType : char {
87+
NONE = 0,
88+
CODE,
89+
DATA,
90+
};
91+
8592
enum class MemoryContentsType : char {
8693
UNKNOWN = 0, /// Unknown contents.
8794
POSSIBLE_JUMP_TABLE, /// Possibly a non-PIC jump table.
@@ -549,6 +556,9 @@ class BinaryContext {
549556

550557
std::unique_ptr<MCDisassembler> DisAsm;
551558

559+
/// Symbolic disassembler.
560+
std::unique_ptr<MCDisassembler> SymbolicDisAsm;
561+
552562
std::unique_ptr<MCAsmBackend> MAB;
553563

554564
/// Indicates if relocations are available for usage.
@@ -662,6 +672,11 @@ class BinaryContext {
662672
TheTriple->getArch() == llvm::Triple::x86_64;
663673
}
664674

675+
// AArch64-specific functions to check if symbol is used to delimit
676+
// code/data in .text. Code is marked by $x, data by $d.
677+
MarkerSymType getMarkerType(const SymbolRef &Symbol) const;
678+
bool isMarker(const SymbolRef &Symbol) const;
679+
665680
/// Iterate over all BinaryData.
666681
iterator_range<binary_data_const_iterator> getBinaryData() const {
667682
return make_range(BinaryDataMap.begin(), BinaryDataMap.end());
@@ -1187,18 +1202,20 @@ class BinaryContext {
11871202
uint64_t Offset = 0,
11881203
const BinaryFunction *Function = nullptr,
11891204
bool PrintMCInst = false, bool PrintMemData = false,
1190-
bool PrintRelocations = false) const;
1205+
bool PrintRelocations = false,
1206+
StringRef Endl = "\n") const;
11911207

11921208
/// Print a range of instructions.
11931209
template <typename Itr>
11941210
uint64_t
11951211
printInstructions(raw_ostream &OS, Itr Begin, Itr End, uint64_t Offset = 0,
11961212
const BinaryFunction *Function = nullptr,
11971213
bool PrintMCInst = false, bool PrintMemData = false,
1198-
bool PrintRelocations = false) const {
1214+
bool PrintRelocations = false,
1215+
StringRef Endl = "\n") const {
11991216
while (Begin != End) {
12001217
printInstruction(OS, *Begin, Offset, Function, PrintMCInst, PrintMemData,
1201-
PrintRelocations);
1218+
PrintRelocations, Endl);
12021219
Offset += computeCodeSize(Begin, Begin + 1);
12031220
++Begin;
12041221
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//==- bolt/Core/BinaryDomTree.h - Dominator Tree at low-level IR -*- C++ -*-==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file defines the BinaryDomTree class, which represents a dominator tree
10+
// in the CFG of a binary function.
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
#ifndef BOLT_CORE_BINARY_DOMTREE_H
15+
#define BOLT_CORE_BINARY_DOMTREE_H
16+
17+
#include "llvm/Support/GenericDomTreeConstruction.h"
18+
19+
namespace llvm {
20+
namespace bolt {
21+
22+
class BinaryBasicBlock;
23+
using BinaryDomTreeNode = DomTreeNodeBase<BinaryBasicBlock>;
24+
using BinaryDominatorTree = DomTreeBase<BinaryBasicBlock>;
25+
26+
} // namespace bolt
27+
28+
// BinaryDominatorTree GraphTraits specializations.
29+
template <>
30+
struct GraphTraits<bolt::BinaryDomTreeNode *>
31+
: public DomTreeGraphTraitsBase<bolt::BinaryDomTreeNode,
32+
bolt::BinaryDomTreeNode::iterator> {};
33+
34+
template <>
35+
struct GraphTraits<const bolt::BinaryDomTreeNode *>
36+
: public DomTreeGraphTraitsBase<const bolt::BinaryDomTreeNode,
37+
bolt::BinaryDomTreeNode::const_iterator> {};
38+
39+
template <>
40+
struct GraphTraits<bolt::BinaryDominatorTree *>
41+
: public GraphTraits<bolt::BinaryDomTreeNode *> {
42+
static NodeRef getEntryNode(bolt::BinaryDominatorTree *DT) {
43+
return DT->getRootNode();
44+
}
45+
46+
static nodes_iterator nodes_begin(bolt::BinaryDominatorTree *N) {
47+
return df_begin(getEntryNode(N));
48+
}
49+
50+
static nodes_iterator nodes_end(bolt::BinaryDominatorTree *N) {
51+
return df_end(getEntryNode(N));
52+
}
53+
};
54+
55+
} // namespace llvm
56+
57+
#endif

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,6 @@ class BinaryFunction {
667667
uint64_t Offset,
668668
uint64_t &TargetAddress);
669669

670-
DenseMap<const MCInst *, SmallVector<MCInst *, 4>>
671-
computeLocalUDChain(const MCInst *CurInstr);
672-
673670
BinaryFunction &operator=(const BinaryFunction &) = delete;
674671
BinaryFunction(const BinaryFunction &) = delete;
675672

@@ -836,6 +833,15 @@ class BinaryFunction {
836833
return make_range(JumpTables.begin(), JumpTables.end());
837834
}
838835

836+
/// Return relocation associated with a given \p Offset in the function,
837+
/// or nullptr if no such relocation exists.
838+
const Relocation *getRelocationAt(uint64_t Offset) const {
839+
assert(CurrentState == State::Empty &&
840+
"Relocations unavailable in the current function state.");
841+
auto RI = Relocations.find(Offset);
842+
return (RI == Relocations.end()) ? nullptr : &RI->second;
843+
}
844+
839845
/// Returns the raw binary encoding of this function.
840846
ErrorOr<ArrayRef<uint8_t>> getData() const;
841847

@@ -1951,11 +1957,6 @@ class BinaryFunction {
19511957
return ColdLSDASymbol;
19521958
}
19531959

1954-
/// True if the symbol is a mapping symbol used in AArch64 to delimit
1955-
/// data inside code section.
1956-
bool isDataMarker(const SymbolRef &Symbol, uint64_t SymbolSize) const;
1957-
bool isCodeMarker(const SymbolRef &Symbol, uint64_t SymbolSize) const;
1958-
19591960
void setOutputDataAddress(uint64_t Address) { OutputDataOffset = Address; }
19601961

19611962
uint64_t getOutputDataAddress() const { return OutputDataOffset; }

bolt/include/bolt/Core/BinaryLoop.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,13 @@
1515
#ifndef BOLT_CORE_BINARY_LOOP_H
1616
#define BOLT_CORE_BINARY_LOOP_H
1717

18-
#include "llvm/ADT/DepthFirstIterator.h"
1918
#include "llvm/Analysis/LoopInfoImpl.h"
20-
#include "llvm/Support/GenericDomTreeConstruction.h"
2119

2220
namespace llvm {
2321
namespace bolt {
2422

2523
class BinaryBasicBlock;
2624

27-
using BinaryDomTreeNode = DomTreeNodeBase<BinaryBasicBlock>;
28-
using BinaryDominatorTree = DomTreeBase<BinaryBasicBlock>;
29-
3025
class BinaryLoop : public LoopBase<BinaryBasicBlock, BinaryLoop> {
3126
public:
3227
BinaryLoop() : LoopBase<BinaryBasicBlock, BinaryLoop>() {}
@@ -62,35 +57,4 @@ class BinaryLoopInfo : public LoopInfoBase<BinaryBasicBlock, BinaryLoop> {
6257
} // namespace bolt
6358
} // namespace llvm
6459

65-
namespace llvm {
66-
67-
// BinaryDominatorTree GraphTraits specializations.
68-
template <>
69-
struct GraphTraits<bolt::BinaryDomTreeNode *>
70-
: public DomTreeGraphTraitsBase<bolt::BinaryDomTreeNode,
71-
bolt::BinaryDomTreeNode::iterator> {};
72-
73-
template <>
74-
struct GraphTraits<const bolt::BinaryDomTreeNode *>
75-
: public DomTreeGraphTraitsBase<const bolt::BinaryDomTreeNode,
76-
bolt::BinaryDomTreeNode::const_iterator> {};
77-
78-
template <>
79-
struct GraphTraits<bolt::BinaryDominatorTree *>
80-
: public GraphTraits<bolt::BinaryDomTreeNode *> {
81-
static NodeRef getEntryNode(bolt::BinaryDominatorTree *DT) {
82-
return DT->getRootNode();
83-
}
84-
85-
static nodes_iterator nodes_begin(bolt::BinaryDominatorTree *N) {
86-
return df_begin(getEntryNode(N));
87-
}
88-
89-
static nodes_iterator nodes_end(bolt::BinaryDominatorTree *N) {
90-
return df_end(getEntryNode(N));
91-
}
92-
};
93-
94-
} // namespace llvm
95-
9660
#endif

0 commit comments

Comments
 (0)