Skip to content

Commit 97d30eb

Browse files
committed
Merge from 'main' to 'sycl-web' (201 commits)
CONFLICT (content): Merge conflict in llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
2 parents 0e04724 + 2cd43e9 commit 97d30eb

File tree

557 files changed

+18003
-4654
lines changed

Some content is hidden

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

557 files changed

+18003
-4654
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
required: false
1111
projects:
1212
required: false
13+
extra_cmake_args:
14+
required: false
15+
os_list:
16+
required: false
17+
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
1318
workflow_call:
1419
inputs:
1520
build_target:
@@ -20,6 +25,19 @@ on:
2025
required: true
2126
type: string
2227

28+
extra_cmake_args:
29+
required: false
30+
type: string
31+
32+
os_list:
33+
required: false
34+
type: string
35+
# Use windows-2019 due to:
36+
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
37+
# We're using a specific version of macOS due to:
38+
# https://github.com/actions/virtual-environments/issues/5900
39+
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
40+
2341
concurrency:
2442
# Skip intermediate builds: always.
2543
# Cancel intermediate builds: only if it is a pull request build.
@@ -35,14 +53,7 @@ jobs:
3553
strategy:
3654
fail-fast: false
3755
matrix:
38-
os:
39-
- ubuntu-latest
40-
# Use windows-2019 due to:
41-
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
- windows-2019
43-
# We're using a specific version of macOS due to:
44-
# https://github.com/actions/virtual-environments/issues/5900
45-
- macOS-11
56+
os: ${{ fromJSON(inputs.os_list) }}
4657
steps:
4758
- name: Setup Windows
4859
if: startsWith(matrix.os, 'windows')
@@ -85,7 +96,7 @@ jobs:
8596
# This should be a no-op for non-mac OSes
8697
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
8798
with:
88-
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
99+
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ inputs.extra_cmake_args }}'
89100
build_target: '${{ inputs.build_target }}'
90101

91102
- name: Build and Test libclc

.github/workflows/spirv-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: SPIR-V Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
paths:
10+
- 'llvm/lib/Target/SPIRV/**'
11+
- 'llvm/test/CodeGen/SPIRV/**'
12+
- '.github/workflows/spirv-tests.yml'
13+
14+
concurrency:
15+
# Skip intermediate builds: always.
16+
# Cancel intermediate builds: only if it is a pull request build.
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
19+
20+
jobs:
21+
check_spirv:
22+
if: github.repository_owner == 'llvm'
23+
name: Test SPIR-V
24+
uses: ./.github/workflows/llvm-project-tests.yml
25+
with:
26+
build_target: check-llvm-codegen-spirv
27+
projects:
28+
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="SPIRV"'
29+
os_list: '["ubuntu-latest"]'

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
3434
3535
36+
Jianjian GUAN <[email protected]>
37+
3638
3739
3840

bolt/lib/Passes/IndirectCallPromotion.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ static cl::opt<bool> ICPPeelForInline(
158158

159159
} // namespace opts
160160

161+
#ifndef NDEBUG
161162
static bool verifyProfile(std::map<uint64_t, BinaryFunction> &BFs) {
162163
bool IsValid = true;
163164
for (auto &BFI : BFs) {
@@ -182,6 +183,7 @@ static bool verifyProfile(std::map<uint64_t, BinaryFunction> &BFs) {
182183
}
183184
return IsValid;
184185
}
186+
#endif
185187

186188
namespace llvm {
187189
namespace bolt {
@@ -1467,7 +1469,6 @@ void IndirectCallPromotion::runOnFunctions(BinaryContext &BC) {
14671469
std::max<uint64_t>(TotalIndexBasedCandidates, 1))
14681470
<< "%\n";
14691471

1470-
(void)verifyProfile;
14711472
#ifndef NDEBUG
14721473
verifyProfile(BFs);
14731474
#endif

bolt/lib/Passes/ReorderAlgorithm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <random>
2121
#include <stack>
2222

23-
#undef DEBUG_TYPE
23+
#undef DEBUG_TYPE
2424
#define DEBUG_TYPE "bolt"
2525

2626
using namespace llvm;
@@ -425,7 +425,7 @@ void TSPReorderAlgorithm::reorderBasicBlocks(BinaryFunction &BF,
425425
}
426426

427427
std::vector<std::vector<int64_t>> DP;
428-
DP.resize(1 << N);
428+
DP.resize(static_cast<size_t>(1) << N);
429429
for (std::vector<int64_t> &Elmt : DP)
430430
Elmt.resize(N, -1);
431431

clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,21 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
133133
"::boost::system::error_code"))),
134134
AllowCastToVoid(Options.get("AllowCastToVoid", false)) {}
135135

136+
UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
137+
ClangTidyContext *Context,
138+
std::string CheckedFunctions)
139+
: UnusedReturnValueCheck(Name, Context, std::move(CheckedFunctions), {},
140+
false) {}
141+
142+
UnusedReturnValueCheck::UnusedReturnValueCheck(
143+
llvm::StringRef Name, ClangTidyContext *Context,
144+
std::string CheckedFunctions, std::vector<StringRef> CheckedReturnTypes,
145+
bool AllowCastToVoid)
146+
: ClangTidyCheck(Name, Context),
147+
CheckedFunctions(std::move(CheckedFunctions)),
148+
CheckedReturnTypes(std::move(CheckedReturnTypes)),
149+
AllowCastToVoid(AllowCastToVoid) {}
150+
136151
void UnusedReturnValueCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
137152
Options.store(Opts, "CheckedFunctions", CheckedFunctions);
138153
Options.store(Opts, "CheckedReturnTypes",

clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ class UnusedReturnValueCheck : public ClangTidyCheck {
3131
private:
3232
std::string CheckedFunctions;
3333
const std::vector<StringRef> CheckedReturnTypes;
34-
const bool AllowCastToVoid;
34+
35+
protected:
36+
UnusedReturnValueCheck(StringRef Name, ClangTidyContext *Context,
37+
std::string CheckedFunctions);
38+
UnusedReturnValueCheck(StringRef Name, ClangTidyContext *Context,
39+
std::string CheckedFunctions,
40+
std::vector<StringRef> CheckedReturnTypes,
41+
bool AllowCastToVoid);
42+
bool AllowCastToVoid;
3543
};
3644

3745
} // namespace clang::tidy::bugprone

clang-tools-extra/clang-tidy/hicpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS
66
add_clang_library(clangTidyHICPPModule
77
ExceptionBaseclassCheck.cpp
88
HICPPTidyModule.cpp
9+
IgnoredRemoveResultCheck.cpp
910
MultiwayPathsCoveredCheck.cpp
1011
NoAssemblerCheck.cpp
1112
SignedBitwiseCheck.cpp

clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "../readability/NamedParameterCheck.h"
3838
#include "../readability/UppercaseLiteralSuffixCheck.h"
3939
#include "ExceptionBaseclassCheck.h"
40+
#include "IgnoredRemoveResultCheck.h"
4041
#include "MultiwayPathsCoveredCheck.h"
4142
#include "NoAssemblerCheck.h"
4243
#include "SignedBitwiseCheck.h"
@@ -57,6 +58,8 @@ class HICPPModule : public ClangTidyModule {
5758
"hicpp-deprecated-headers");
5859
CheckFactories.registerCheck<ExceptionBaseclassCheck>(
5960
"hicpp-exception-baseclass");
61+
CheckFactories.registerCheck<IgnoredRemoveResultCheck>(
62+
"hicpp-ignored-remove-result");
6063
CheckFactories.registerCheck<MultiwayPathsCoveredCheck>(
6164
"hicpp-multiway-paths-covered");
6265
CheckFactories.registerCheck<SignedBitwiseCheck>("hicpp-signed-bitwise");
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===--- IgnoredRemoveResultCheck.cpp - clang-tidy ------------------------===//
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+
#include "IgnoredRemoveResultCheck.h"
10+
11+
namespace clang::tidy::hicpp {
12+
13+
IgnoredRemoveResultCheck::IgnoredRemoveResultCheck(llvm::StringRef Name,
14+
ClangTidyContext *Context)
15+
: UnusedReturnValueCheck(Name, Context,
16+
"::std::remove;"
17+
"::std::remove_if;"
18+
"::std::unique") {
19+
// The constructor for ClangTidyCheck needs to have been called
20+
// before we can access options via Options.get().
21+
AllowCastToVoid = Options.get("AllowCastToVoid", true);
22+
}
23+
24+
void IgnoredRemoveResultCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
25+
Options.store(Opts, "AllowCastToVoid", AllowCastToVoid);
26+
}
27+
28+
} // namespace clang::tidy::hicpp

0 commit comments

Comments
 (0)