Skip to content

Commit d250087

Browse files
author
aidan.belton
committed
resolve conflict
2 parents ecb24c4 + 3c7971d commit d250087

File tree

6,564 files changed

+395363
-166193
lines changed

Some content is hidden

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

6,564 files changed

+395363
-166193
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ sycl/include/CL/sycl/swizzles.def @turinevgeny
7575
sycl/include/CL/sycl/types.hpp @turinevgeny
7676

7777
# XPTI instrumentation utilities
78-
xpti/ @tovinkere @andykaylor
79-
xptifw/ @tovinkere @andykaylor
78+
xpti/ @tovinkere @andykaylor @alexbatashev
79+
xptifw/ @tovinkere @andykaylor @alexbatashev
8080

8181
# DPC++ tools
8282
llvm/**/append-file/ @mdtoguchi @AGindinson
@@ -99,10 +99,10 @@ clang/tools/clang-offload-deps/ @sndmitriev @mlychkov @AlexeySachkov
9999
clang/tools/clang-offload-extract/ @sndmitriev @mlychkov @AlexeySachkov
100100

101101
# Explicit SIMD
102-
SYCLLowerIR/ @kbobrovs @DenisBakhvalov
103-
esimd/ @kbobrovs @DenisBakhvalov
104-
sycl/include/sycl/ext/intel/experimental/esimd.hpp @kbobrovs @DenisBakhvalov
105-
sycl/doc/extensions/ExplicitSIMD/ @kbobrovs
102+
SYCLLowerIR/ @kbobrovs @DenisBakhvalov @kychendev
103+
esimd/ @kbobrovs @DenisBakhvalov @kychendev
104+
sycl/include/sycl/ext/intel/experimental/esimd.hpp @kbobrovs @DenisBakhvalov @kychendev
105+
sycl/doc/extensions/ExplicitSIMD/ @kbobrovs @DenisBakhvalov @kychendev
106106

107107
# ITT annotations
108108
llvm/lib/Transforms/Instrumentation/SPIRITTAnnotations.cpp @MrSidims @vzakhari

.mailmap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
2929
3030
31-
Jon Roelofs <[email protected]> Jon Roelofs <jroelofs@jroelofs.com>
32-
Jon Roelofs <[email protected]> Jonathan Roelofs <jonathan@codesourcery.com>
33-
Jon Roelofs <[email protected]> Jonathan Roelofs <jroelofs@jroelofs.com>
31+
Jon Roelofs <[email protected]> <jonathan@codesourcery.com>
32+
Jon Roelofs <[email protected]> <jroelofs@jroelofs.com>
33+
LLVM GN Syncbot <llvmgnsyncbot@gmail.com>
3434
Martin Storsjö <[email protected]>
35-
Saleem Abdulrasool <[email protected]> <[email protected]>
35+
Saleem Abdulrasool <[email protected]>

CONTRIBUTING.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ There are 3 types of tests which are used for DPC++ toolchain validation:
6666
should not have hardware (e.g. GPU, FPGA, etc.) or external software
6767
dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
6868
this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
69-
However, the tests for a feature under active development requiring atomic
70-
change for tests and product can be put to
71-
[sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer
72-
responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once
73-
the feature is stabilized.
7469

7570
**Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)**:
7671
- Use `sycl::` namespace instead of `cl::sycl::`

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
# Intel Project for LLVM\* technology
22

3-
## Introduction
3+
Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects:
44

5-
Intel staging area for llvm.org contribution.
6-
Home for Intel LLVM-based projects:
5+
## oneAPI Data Parallel C++ compiler
76

8-
* oneAPI Data Parallel C++ compiler - see
9-
[sycl](https://github.com/intel/llvm/tree/sycl) branch. More information on
10-
oneAPI and DPC++ is available at
11-
[https://www.oneapi.com/](https://www.oneapi.com/)
12-
* [![Linux Post Commit Checks](https://github.com/intel/llvm/workflows/Linux%20Post%20Commit%20Checks/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Linux+Post+Commit+Checks%22)
13-
[![Generate Doxygen documentation](https://github.com/intel/llvm/workflows/Generate%20Doxygen%20documentation/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Generate+Doxygen+documentation%22)
14-
* Late-outline OpenMP\* and OpenMP\* Offload - see
15-
[openmp](https://github.com/intel/llvm/tree/openmp) branch.
7+
[![](https://spec.oneapi.io/oneapi-logo-white-scaled.jpg)](https://www.oneapi.io/)
168

17-
## License
9+
See [sycl](https://github.com/intel/llvm/tree/sycl) branch and
10+
[DPC++ Documentation](https://intel.github.io/llvm-docs/).
1811

19-
See [LICENSE.txt](sycl/LICENSE.TXT) for details.
12+
[![Linux Post Commit Checks](https://github.com/intel/llvm/workflows/Linux%20Post%20Commit%20Checks/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Linux+Post+Commit+Checks%22)
13+
[![Generate Doxygen documentation](https://github.com/intel/llvm/workflows/Generate%20Doxygen%20documentation/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Generate+Doxygen+documentation%22)
2014

21-
## Contributing
15+
DPC++ is an open, cross-architecture language built upon the ISO C++ and Khronos
16+
SYCL\* standards. DPC++ extends these standards with a number of extensions,
17+
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
2218

23-
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
19+
## Late-outline OpenMP\* and OpenMP\* Offload
20+
See [openmp](https://github.com/intel/llvm/tree/openmp) branch.
2421

25-
## Sub-projects Documentation
22+
# License
2623

27-
* oneAPI Data Parallel C++ compiler - See
28-
[DPC++ Documentation](https://intel.github.io/llvm-docs/)
29-
* Late-outline OpenMP\* and OpenMP\* Offload - TBD
24+
See [LICENSE.txt](sycl/LICENSE.TXT) for details.
3025

31-
## DPC++ extensions
26+
# Contributing
3227

33-
DPC++ is an open, cross-architecture language built upon the ISO C++ and Khronos
34-
SYCL\* standards. DPC++ extends these standards with a number of extensions,
35-
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
28+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
3629

3730
*\*Other names and brands may be claimed as the property of others.*

buildbot/configure.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def do_configure(args):
2929
libclc_targets_to_build = ''
3030
libclc_gen_remangled_variants = 'OFF'
3131
sycl_build_pi_cuda = 'OFF'
32-
sycl_build_pi_esimd_cpu = 'ON'
32+
sycl_build_pi_esimd_cpu = 'OFF'
3333
sycl_build_pi_rocm = 'OFF'
3434
sycl_build_pi_rocm_platform = 'AMD'
3535
sycl_werror = 'ON'
@@ -45,8 +45,8 @@ def do_configure(args):
4545
if args.arm:
4646
llvm_targets_to_build = 'ARM;AArch64'
4747

48-
if args.disable_esimd_cpu:
49-
sycl_build_pi_esimd_cpu = 'OFF'
48+
if args.enable_esimd_cpu_emulation:
49+
sycl_build_pi_esimd_cpu = 'ON'
5050

5151
if args.cuda or args.rocm:
5252
llvm_enable_projects += ';libclc'
@@ -61,6 +61,9 @@ def do_configure(args):
6161
if args.rocm_platform == 'AMD':
6262
llvm_targets_to_build += ';AMDGPU'
6363
libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa'
64+
65+
# The ROCm plugin for AMD uses lld for linking
66+
llvm_enable_projects += ';lld'
6467
elif args.rocm_platform == 'NVIDIA' and not args.cuda:
6568
llvm_targets_to_build += ';NVPTX'
6669
libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
@@ -178,7 +181,7 @@ def main():
178181
parser.add_argument("--rocm", action='store_true', help="switch from OpenCL to ROCm")
179182
parser.add_argument("--rocm-platform", type=str, choices=['AMD', 'NVIDIA'], default='AMD', help="choose ROCm backend")
180183
parser.add_argument("--arm", action='store_true', help="build ARM support rather than x86")
181-
parser.add_argument("--disable-esimd-cpu", action='store_true', help="build without ESIMD_CPU support")
184+
parser.add_argument("--enable-esimd-cpu-emulation", action='store_true', help="build with ESIMD_CPU emulation support")
182185
parser.add_argument("--no-assertions", action='store_true', help="build without assertions")
183186
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
184187
parser.add_argument("--no-werror", action='store_true', help="Don't treat warnings as errors")

buildbot/dependency.conf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ ocl_cpu_rt_ver=2021.12.6.0.19
44
# https://github.com/intel/llvm/releases/download/2021-WW26/win-oclcpuexp-2021.12.6.0.19_rel.zip
55
ocl_cpu_rt_ver_win=2021.12.6.0.19
66
# Same GPU driver supports Level Zero and OpenCL
7-
# https://github.com/intel/compute-runtime/releases/tag/21.26.20194
8-
ocl_gpu_rt_ver=21.26.20194
7+
# https://github.com/intel/compute-runtime/releases/tag/21.33.20678
8+
ocl_gpu_rt_ver=21.33.20678
99
# Same GPU driver supports Level Zero and OpenCL
10-
# https://downloadmirror.intel.com/30579/a08/igfx_win_100.9684.zip
11-
# https://downloadmirror.intel.com/30381/a08/igfx_win10_100.9466.zip
12-
ocl_gpu_rt_ver_win=30.0.100.9684
10+
# https://downloadmirror.intel.com/646152/igfx_win_100.9805.zip
11+
ocl_gpu_rt_ver_win=30.0.100.9805
1312
intel_sycl_ver=build
1413

1514
# TBB binaries can be built from sources following instructions under
@@ -31,8 +30,8 @@ ocloc_ver_win=27.20.100.9168
3130
[DRIVER VERSIONS]
3231
cpu_driver_lin=2021.12.6.0.19
3332
cpu_driver_win=2021.12.6.0.19
34-
gpu_driver_lin=21.26.20194
35-
gpu_driver_win=30.0.100.9684
33+
gpu_driver_lin=21.33.20678
34+
gpu_driver_win=30.0.100.9805
3635
fpga_driver_lin=2021.12.6.0.19
3736
fpga_driver_win=2021.12.6.0.19
3837
# NVidia CUDA driver

clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ makeRewriteRule(const std::vector<std::string> &StringLikeClassNames,
5353
to(varDecl(hasName("npos"), hasDeclContext(StringLikeClass))));
5454
auto StringFind = cxxMemberCallExpr(
5555
callee(cxxMethodDecl(
56-
hasName("find"),
56+
hasName("find"), parameterCountIs(2),
5757
hasParameter(
5858
0, parmVarDecl(anyOf(hasType(StringType), hasType(CharStarType),
5959
hasType(CharType)))))),

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//===--- BranchCloneCheck.cpp - clang-tidy --------------------------------===//
22
//
3-
// The LLVM Compiler Infrastructure
4-
//
5-
// This file is distributed under the University of Illinois Open Source
6-
// License. See LICENSE.TXT for details.
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
76
//
87
//===----------------------------------------------------------------------===//
98

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//===--- BranchCloneCheck.h - clang-tidy ------------------------*- C++ -*-===//
22
//
3-
// The LLVM Compiler Infrastructure
4-
//
5-
// This file is distributed under the University of Illinois Open Source
6-
// License. See LICENSE.TXT for details.
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
76
//
87
//===----------------------------------------------------------------------===//
98

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "StringLiteralWithEmbeddedNulCheck.h"
5353
#include "SuspiciousEnumUsageCheck.h"
5454
#include "SuspiciousIncludeCheck.h"
55+
#include "SuspiciousMemoryComparisonCheck.h"
5556
#include "SuspiciousMemsetUsageCheck.h"
5657
#include "SuspiciousMissingCommaCheck.h"
5758
#include "SuspiciousSemicolonCheck.h"
@@ -160,6 +161,8 @@ class BugproneModule : public ClangTidyModule {
160161
"bugprone-suspicious-enum-usage");
161162
CheckFactories.registerCheck<SuspiciousIncludeCheck>(
162163
"bugprone-suspicious-include");
164+
CheckFactories.registerCheck<SuspiciousMemoryComparisonCheck>(
165+
"bugprone-suspicious-memory-comparison");
163166
CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>(
164167
"bugprone-suspicious-memset-usage");
165168
CheckFactories.registerCheck<SuspiciousMissingCommaCheck>(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ add_clang_library(clangTidyBugproneModule
4747
StringLiteralWithEmbeddedNulCheck.cpp
4848
SuspiciousEnumUsageCheck.cpp
4949
SuspiciousIncludeCheck.cpp
50+
SuspiciousMemoryComparisonCheck.cpp
5051
SuspiciousMemsetUsageCheck.cpp
5152
SuspiciousMissingCommaCheck.cpp
5253
SuspiciousSemicolonCheck.cpp

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static const std::string DefaultIgnoredParameterTypeSuffixes =
5656
"reverse_const_iterator",
5757
"ConstReverseIterator",
5858
"Const_Reverse_Iterator",
59-
"const_reverse_iterator"
59+
"const_reverse_iterator",
6060
"Constreverseiterator",
6161
"constreverseiterator"});
6262

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
//===--- SuspiciousMemoryComparisonCheck.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 "SuspiciousMemoryComparisonCheck.h"
10+
#include "clang/AST/ASTContext.h"
11+
#include "clang/ASTMatchers/ASTMatchFinder.h"
12+
13+
using namespace clang::ast_matchers;
14+
15+
namespace clang {
16+
namespace tidy {
17+
namespace bugprone {
18+
19+
static llvm::Optional<uint64_t> tryEvaluateSizeExpr(const Expr *SizeExpr,
20+
const ASTContext &Ctx) {
21+
Expr::EvalResult Result;
22+
if (SizeExpr->EvaluateAsRValue(Result, Ctx))
23+
return Ctx.toBits(
24+
CharUnits::fromQuantity(Result.Val.getInt().getExtValue()));
25+
return None;
26+
}
27+
28+
void SuspiciousMemoryComparisonCheck::registerMatchers(MatchFinder *Finder) {
29+
Finder->addMatcher(
30+
callExpr(allOf(callee(namedDecl(
31+
anyOf(hasName("::memcmp"), hasName("::std::memcmp")))),
32+
unless(isInstantiationDependent())))
33+
.bind("call"),
34+
this);
35+
}
36+
37+
void SuspiciousMemoryComparisonCheck::check(
38+
const MatchFinder::MatchResult &Result) {
39+
const ASTContext &Ctx = *Result.Context;
40+
const auto *CE = Result.Nodes.getNodeAs<CallExpr>("call");
41+
42+
const Expr *SizeExpr = CE->getArg(2);
43+
assert(SizeExpr != nullptr && "Third argument of memcmp is mandatory.");
44+
llvm::Optional<uint64_t> ComparedBits = tryEvaluateSizeExpr(SizeExpr, Ctx);
45+
46+
for (unsigned int ArgIndex = 0; ArgIndex < 2; ++ArgIndex) {
47+
const Expr *ArgExpr = CE->getArg(ArgIndex);
48+
QualType ArgType = ArgExpr->IgnoreImplicit()->getType();
49+
const Type *PointeeType = ArgType->getPointeeOrArrayElementType();
50+
assert(PointeeType != nullptr && "PointeeType should always be available.");
51+
QualType PointeeQualifiedType(PointeeType, 0);
52+
53+
if (PointeeType->isRecordType()) {
54+
if (const RecordDecl *RD =
55+
PointeeType->getAsRecordDecl()->getDefinition()) {
56+
if (const auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) {
57+
if (!CXXDecl->isStandardLayout()) {
58+
diag(CE->getBeginLoc(),
59+
"comparing object representation of non-standard-layout type "
60+
"%0; consider using a comparison operator instead")
61+
<< PointeeQualifiedType;
62+
break;
63+
}
64+
}
65+
}
66+
}
67+
68+
if (!PointeeType->isIncompleteType()) {
69+
uint64_t PointeeSize = Ctx.getTypeSize(PointeeType);
70+
if (ComparedBits.hasValue() && *ComparedBits >= PointeeSize &&
71+
!Ctx.hasUniqueObjectRepresentations(PointeeQualifiedType)) {
72+
diag(CE->getBeginLoc(),
73+
"comparing object representation of type %0 which does not have a "
74+
"unique object representation; consider comparing %select{the "
75+
"values|the members of the object}1 manually")
76+
<< PointeeQualifiedType << (PointeeType->isRecordType() ? 1 : 0);
77+
break;
78+
}
79+
}
80+
}
81+
}
82+
83+
} // namespace bugprone
84+
} // namespace tidy
85+
} // namespace clang
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//===--- SuspiciousMemoryComparisonCheck.h - clang-tidy ---------*- 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+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMEMORYCOMPARISONCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMEMORYCOMPARISONCHECK_H
11+
12+
#include "../ClangTidyCheck.h"
13+
14+
namespace clang {
15+
namespace tidy {
16+
namespace bugprone {
17+
18+
/// Finds potentially incorrect calls to ``memcmp()`` based on properties of the
19+
/// arguments.
20+
///
21+
/// For the user-facing documentation see:
22+
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memory-comparison.html
23+
class SuspiciousMemoryComparisonCheck : public ClangTidyCheck {
24+
public:
25+
SuspiciousMemoryComparisonCheck(StringRef Name, ClangTidyContext *Context)
26+
: ClangTidyCheck(Name, Context) {}
27+
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
28+
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
29+
};
30+
31+
} // namespace bugprone
32+
} // namespace tidy
33+
} // namespace clang
34+
35+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMEMORYCOMPARISONCHECK_H

clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "../bugprone/SignalHandlerCheck.h"
1515
#include "../bugprone/SignedCharMisuseCheck.h"
1616
#include "../bugprone/SpuriouslyWakeUpFunctionsCheck.h"
17+
#include "../bugprone/SuspiciousMemoryComparisonCheck.h"
1718
#include "../bugprone/UnhandledSelfAssignmentCheck.h"
1819
#include "../concurrency/ThreadCanceltypeAsynchronousCheck.h"
1920
#include "../google/UnnamedNamespaceInHeaderCheck.h"
@@ -98,8 +99,13 @@ class CERTModule : public ClangTidyModule {
9899
"cert-dcl37-c");
99100
// ENV
100101
CheckFactories.registerCheck<CommandProcessorCheck>("cert-env33-c");
102+
// EXP
103+
CheckFactories.registerCheck<bugprone::SuspiciousMemoryComparisonCheck>(
104+
"cert-exp42-c");
101105
// FLP
102106
CheckFactories.registerCheck<FloatLoopCounter>("cert-flp30-c");
107+
CheckFactories.registerCheck<bugprone::SuspiciousMemoryComparisonCheck>(
108+
"cert-flp37-c");
103109
// FIO
104110
CheckFactories.registerCheck<misc::NonCopyableObjectsCheck>("cert-fio38-c");
105111
// ERR

0 commit comments

Comments
 (0)