Skip to content

Commit

Permalink
Implement the default constructor access hack for handling of special…
Browse files Browse the repository at this point in the history
… types in free function kernels
  • Loading branch information
lbushi25 committed Nov 18, 2024
2 parents 336c90e + 5bd6e3b commit ec91887
Show file tree
Hide file tree
Showing 9,578 changed files with 532,323 additions and 257,538 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 6 additions & 3 deletions .ci/generate-buildkite-pipeline-premerge
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,17 @@ function keep-modified-projects() {
}

function check-targets() {
# Do not use "check-all" here because if there is "check-all" plus a
# project specific target like "check-clang", that project's tests
# will be run twice.
projects=${@}
for project in ${projects}; do
case ${project} in
clang-tools-extra)
echo "check-clang-tools"
;;
compiler-rt)
echo "check-all"
echo "check-compiler-rt"
;;
cross-project-tests)
echo "check-cross-project"
Expand All @@ -216,10 +219,10 @@ function check-targets() {
echo "check-lldb"
;;
pstl)
echo "check-all"
# Currently we do not run pstl tests in CI.
;;
libclc)
echo "check-all"
# Currently there is no testing for libclc.
;;
*)
echo "check-${project}"
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.github/CODEOWNERS merge=ours

libcxx/src/**/*.cpp merge=libcxx-reformat
libcxx/include/**/*.h merge=libcxx-reformat

Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ sycl/test-e2e/SeparateCompile/ @intel/dpcpp-tools-reviewers
sycl/test-e2e/Printf/ @intel/dpcpp-tools-reviewers @intel/llvm-reviewers-runtime
sycl/test-e2e/SpecConstants/ @intel/dpcpp-tools-reviewers
sycl/test-e2e/NewOffloadDriver/ @intel/dpcpp-tools-reviewers
sycl/test-e2e/LLVMIntrinsicLowering/ @intel/dpcpp-spirv-reviewers

# Sanitizer
clang/lib/Driver/SanitizerArgs.cpp @intel/dpcpp-sanitizers-review
Expand Down
2 changes: 1 addition & 1 deletion .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ PGO:
- llvm/**/llvm-profdata/**/*
- llvm/**/llvm-profgen/**/*

vectorization:
vectorizers:
- llvm/lib/Transforms/Vectorize/**/*
- llvm/include/llvm/Transforms/Vectorize/**/*

Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,24 @@ jobs:
**/crash_diagnostics/*
macos:
runs-on: macos-14
needs: [ stage1 ]
strategy:
fail-fast: true
fail-fast: false
matrix:
config: [
generic-cxx03,
generic-cxx23,
generic-modules,
apple-configuration
]
include:
- config: generic-cxx03
os: macos-latest
- config: generic-cxx23
os: macos-latest
- config: generic-modules
os: macos-latest
- config: apple-configuration
os: macos-latest
- config: apple-system
os: macos-13
- config: apple-system-hardened
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-binaries-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ on:
- '.github/workflows/release-binaries.yml'
- '.github/workflows/release-binaries-setup-stage/*'
- '.github/workflows/release-binaries-save-stage/*'
- 'clang/cmake/caches/Release.cmake'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || 'dispatch' }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ jobs:
run: |
# Build some of the mlir tools that take a long time to link
if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc
fi
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \
mlir-bytecode-parser-fuzzer \
Expand Down Expand Up @@ -420,6 +420,14 @@ jobs:
attestations: write # For artifact attestations

steps:
- name: Checkout Release Scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
sparse-checkout: |
llvm/utils/release/github-upload-release.py
llvm/utils/git/requirements.txt
sparse-checkout-cone-mode: false

- name: 'Download artifact'
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
Expand All @@ -442,14 +450,6 @@ jobs:
name: ${{ needs.prepare.outputs.release-binary-filename }}-attestation
path: ${{ needs.prepare.outputs.release-binary-filename }}.jsonl

- name: Checkout Release Scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
sparse-checkout: |
llvm/utils/release/github-upload-release.py
llvm/utils/git/requirements.txt
sparse-checkout-cone-mode: false

- name: Install Python Requirements
run: |
pip install --require-hashes -r ./llvm/utils/git/requirements.txt
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ jobs:
ref: main
fetch-depth: 0
path: www-releases
persist-credentials: false

- name: Upload Release Notes
if: env.upload
env:
WWW_RELEASES_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
run: |
mkdir -p ../www-releases/${{ inputs.release-version }}
mv ./docs-build/html-export/* ../www-releases/${{ inputs.release-version }}
cd ../www-releases
mkdir -p www-releases/${{ inputs.release-version }}
mv ./docs-build/html-export/* www-releases/${{ inputs.release-version }}
cd www-releases
git checkout -b ${{ inputs.release-version }}
git add ${{ inputs.release-version }}
git config user.email "[email protected]"
git config user.name "llvmbot"
git commit -a -m "Add ${{ inputs.release-version }} documentation"
git push "https://[email protected]/${{ github.repository_owner }}/www-releases" main:main
git push --force "https://[email protected]/llvmbot/www-releases.git" HEAD:refs/heads/${{ inputs.release-version }}
gh pr create -f -B main -H ${{ inputs.release-version }} -R llvmbot/www-releases
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: results.sarif
1 change: 0 additions & 1 deletion .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ jobs:
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
--cmake-opt="-DNATIVECPU_USE_OCK=Off" \
--cmake-opt="-DSYCL_PI_TESTS=OFF" \
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV"
- name: Compile
id: build
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ jobs:
runner: '["Linux", "amdgpu"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_extra_opts: --device=/dev/dri --device=/dev/kfd
extra_cmake_args: -DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"
- name: CUDA system
runner: '["Linux", "cuda"]'
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ on:
type: string
required: True
extra_cmake_args:
description: |
If empty, then HIP_PLATFORM and AMD_ARCH would be automatically added
if inputs.target_devices contains 'ext_oneapi_hip'
type: string
required: False
tests_selector:
Expand Down Expand Up @@ -282,12 +279,6 @@ jobs:
run: |
if [ -n "$CMAKE_EXTRA_ARGS" ]; then
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
else
if [ "${{ contains(inputs.target_devices, 'ext_oneapi_hip') }}" == "true" ]; then
echo 'opts=-DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"' >> $GITHUB_OUTPUT
else
echo 'opts=' >> $GITHUB_OUTPUT
fi
fi
- name: Configure E2E tests
if: inputs.tests_selector == 'e2e'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/sycl-macos-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions: read-all
jobs:
build:
name: Build
runs-on: macos-12
runs-on: macos-13
env:
CCACHE_DIR: $GITHUB_WORKSPACE/build_cache_${{ inputs.build_cache_suffix }}
CCACHE_MAXSIZE: ${{ inputs.build_cache_size }}
Expand Down Expand Up @@ -52,7 +52,6 @@ jobs:
--ci-defaults $ARGS \
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache \
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
--cmake-opt="-DSYCL_PI_TESTS=OFF"
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
- name: Compile
run: cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain
2 changes: 1 addition & 1 deletion .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
fi
- name: Upload binaries
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8
with:
files: |
sycl_linux.tar.gz
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sycl-windows-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
cmake --build build-e2e --target check-sycl-e2e
- name: Detect hung tests
shell: powershell
if: always()
run: |
$exitCode = 0
$hungTests = Get-Process | Where-Object { ($_.Path -match "llvm\\install") -or ($_.Path -match "llvm\\build-e2e") }
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ autoconf/autom4te.cache
/CMakeSettings.json
# CLion project configuration
/.idea
/cmake-build*

#==============================================================================#
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
Expand Down
1 change: 1 addition & 0 deletions bolt/include/bolt/Core/BinaryBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "bolt/Core/MCPlus.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ErrorOr.h"
Expand Down
9 changes: 5 additions & 4 deletions bolt/include/bolt/Core/BinaryContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ struct SegmentInfo {
uint64_t FileOffset; /// Offset in the file.
uint64_t FileSize; /// Size in file.
uint64_t Alignment; /// Alignment of the segment.
bool IsExecutable; /// Is the executable bit set on the Segment?

void print(raw_ostream &OS) const {
OS << "SegmentInfo { Address: 0x"
<< Twine::utohexstr(Address) << ", Size: 0x"
<< Twine::utohexstr(Size) << ", FileOffset: 0x"
OS << "SegmentInfo { Address: 0x" << Twine::utohexstr(Address)
<< ", Size: 0x" << Twine::utohexstr(Size) << ", FileOffset: 0x"
<< Twine::utohexstr(FileOffset) << ", FileSize: 0x"
<< Twine::utohexstr(FileSize) << ", Alignment: 0x"
<< Twine::utohexstr(Alignment) << "}";
<< Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : " ")
<< "}";
};
};

Expand Down
1 change: 0 additions & 1 deletion bolt/include/bolt/Core/BinaryData.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ inline raw_ostream &operator<<(raw_ostream &OS,
Sep = ",\n ";
TotalCount += AccessInfo.Count;
}
SS.flush();

OS << TotalCount << " total counts : " << TempString;
return OS;
Expand Down
1 change: 0 additions & 1 deletion bolt/include/bolt/Core/BinaryFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ inline raw_ostream &operator<<(raw_ostream &OS,
TotalCount += CSP.Count;
TotalMispreds += CSP.Mispreds;
}
SS.flush();

OS << TotalCount << " (" << TotalMispreds << " misses) :" << TempString;
return OS;
Expand Down
2 changes: 1 addition & 1 deletion bolt/include/bolt/Core/DIEBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class DIEBuilder {

BC.errs()
<< "BOLT-ERROR: unable to find TypeUnit for Type Unit at offset 0x"
<< DU.getOffset() << "\n";
<< Twine::utohexstr(DU.getOffset()) << "\n";
return nullptr;
}

Expand Down
61 changes: 61 additions & 0 deletions bolt/include/bolt/Passes/ContinuityStats.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//===- bolt/Passes/ContinuityStats.h ----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This pass checks how well the BOLT input profile satisfies the following
// "CFG continuity" property of a perfect profile:
//
// Each positive-execution-count block in the function’s CFG
// should be *reachable* from a positive-execution-count function
// entry block through a positive-execution-count path.
//
// More specifically, for each of the hottest 1000 functions, the pass
// calculates the function’s fraction of basic block execution counts
// that is *unreachable*. It then reports the 95th percentile of the
// distribution of the 1000 unreachable fractions in a single BOLT-INFO line.
// The smaller the reported value is, the better the BOLT profile
// satisfies the CFG continuity property.

// The default value of 1000 above can be changed via the hidden BOLT option
// `-num-functions-for-continuity-check=[N]`.
// If more detailed stats are needed, `-v=1` can be used: the hottest N
// functions will be grouped into 5 equally-sized buckets, from the hottest
// to the coldest; for each bucket, various summary statistics of the
// distribution of the unreachable fractions and the raw unreachable execution
// counts will be reported.
//
//===----------------------------------------------------------------------===//

#ifndef BOLT_PASSES_CONTINUITYSTATS_H
#define BOLT_PASSES_CONTINUITYSTATS_H

#include "bolt/Passes/BinaryPasses.h"
#include <vector>

namespace llvm {

class raw_ostream;

namespace bolt {
class BinaryContext;

/// Compute and report to the user the function CFG continuity quality
class PrintContinuityStats : public BinaryFunctionPass {
public:
explicit PrintContinuityStats(const cl::opt<bool> &PrintPass)
: BinaryFunctionPass(PrintPass) {}

bool shouldOptimize(const BinaryFunction &BF) const override;
const char *getName() const override { return "continuity-stats"; }
bool shouldPrint(const BinaryFunction &) const override { return false; }
Error runOnFunctions(BinaryContext &BC) override;
};

} // namespace bolt
} // namespace llvm

#endif // BOLT_PASSES_CONTINUITYSTATS_H
11 changes: 6 additions & 5 deletions bolt/include/bolt/Profile/BoltAddressTranslation.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,13 @@ class BoltAddressTranslation {
uint64_t FuncOutputAddress) const;

/// Write the serialized address translation table for a function.
template <bool Cold>
void writeMaps(std::map<uint64_t, MapTy> &Maps, uint64_t &PrevAddress,
raw_ostream &OS);
template <bool Cold> void writeMaps(uint64_t &PrevAddress, raw_ostream &OS);

/// Read the serialized address translation table for a function.
/// Return a parse error if failed.
template <bool Cold>
void parseMaps(std::vector<uint64_t> &HotFuncs, uint64_t &PrevAddress,
DataExtractor &DE, uint64_t &Offset, Error &Err);
void parseMaps(uint64_t &PrevAddress, DataExtractor &DE, uint64_t &Offset,
Error &Err);

/// Returns the bitmask with set bits corresponding to indices of BRANCHENTRY
/// entries in function address translation map.
Expand All @@ -161,6 +159,9 @@ class BoltAddressTranslation {

std::map<uint64_t, MapTy> Maps;

/// Ordered vector with addresses of hot functions.
std::vector<uint64_t> HotFuncs;

/// Map a function to its basic blocks count
std::unordered_map<uint64_t, size_t> NumBasicBlocksMap;

Expand Down
Loading

0 comments on commit ec91887

Please sign in to comment.