Skip to content

Commit bac3a63

Browse files
committed
Merge from 'main' to 'sycl-web' (127 commits)
2 parents ae4f626 + 5be8c89 commit bac3a63

File tree

465 files changed

+39517
-4236
lines changed

Some content is hidden

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

465 files changed

+39517
-4236
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
#
11+
# This file generates a Buildkite pipeline that triggers the various CI jobs for
12+
# the LLVM project during pre-commit CI (each time a Phabricator diff is uploaded).
13+
#
14+
# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
15+
#
16+
17+
if ! git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/|^clang/"; then
18+
# libcxx/, libcxxabi/, libunwind/, runtimes/, cmake/ or clang/ are not affected
19+
exit 0
20+
fi
21+
22+
reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
23+
if [[ "${reviewID}" != "" ]]; then
24+
buildMessage="https://llvm.org/${reviewID}"
25+
else
26+
buildMessage="Push to branch ${BUILDKITE_BRANCH}"
27+
fi
28+
29+
cat <<EOF
30+
steps:
31+
EOF
32+
33+
# If libc++ or one of the runtimes directories changed
34+
if git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/"; then
35+
cat <<EOF
36+
- trigger: "libcxx-ci"
37+
build:
38+
message: "${buildMessage}"
39+
commit: "${BUILDKITE_COMMIT}"
40+
branch: "${BUILDKITE_BRANCH}"
41+
EOF
42+
fi
43+
44+
# If clang changed
45+
if git diff --name-only HEAD~1 | grep -q -E "^clang/"; then
46+
cat <<EOF
47+
- trigger: "clang-ci"
48+
build:
49+
message: "${buildMessage}"
50+
commit: "${BUILDKITE_COMMIT}"
51+
branch: "${BUILDKITE_BRANCH}"
52+
EOF
53+
fi
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
#
11+
# This file generates a Buildkite pipeline that triggers the various CI jobs for
12+
# the LLVM project on scheduled builds.
13+
#
14+
# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
15+
#
16+
17+
cat <<EOF
18+
steps:
19+
- trigger: "libcxx-ci"
20+
build:
21+
message: "${BUILDKITE_MESSAGE}"
22+
commit: "${BUILDKITE_COMMIT}"
23+
branch: "${BUILDKITE_BRANCH}"
24+
25+
- trigger: "clang-ci"
26+
build:
27+
message: "${BUILDKITE_MESSAGE}"
28+
commit: "${BUILDKITE_COMMIT}"
29+
branch: "${BUILDKITE_BRANCH}"
30+
EOF

clang-tools-extra/clangd/tool/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,23 @@ target_link_libraries(clangdMain
4444
${CLANGD_XPC_LIBS}
4545
)
4646

47+
clang_target_link_libraries(clangd
48+
PRIVATE
49+
clangAST
50+
clangBasic
51+
clangFormat
52+
clangFrontend
53+
clangLex
54+
clangSema
55+
clangTooling
56+
clangToolingCore
57+
clangToolingRefactoring
58+
clangToolingSyntax
59+
)
60+
4761
target_link_libraries(clangd
4862
PRIVATE
4963
clangdMain
64+
clangDaemon
65+
clangdSupport
5066
)

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,10 @@ Bug Fixes in This Version
584584
(`#50243 <https://github.com/llvm/llvm-project/issues/50243>`_),
585585
(`#48636 <https://github.com/llvm/llvm-project/issues/48636>`_),
586586
(`#50320 <https://github.com/llvm/llvm-project/issues/50320>`_).
587-
- Correcly diagnose jumps into statement expressions.
588-
This ensures the behavior of Clang is consistent with GCC.
589-
(`#63682 <https://github.com/llvm/llvm-project/issues/63682>`_)
590-
(`#38717 <https://github.com/llvm/llvm-project/issues/38717>_`).
591587
- Fix an assertion when using ``\u0024`` (``$``) as an identifier, by disallowing
592588
that construct (`#62133 <https://github.com/llvm/llvm-project/issues/38717>_`).
589+
- Fix crash caused by PseudoObjectExprBitfields: NumSubExprs overflow.
590+
(`#63169 <https://github.com/llvm/llvm-project/issues/63169>_`)
593591

594592
Bug Fixes to Compiler Builtins
595593
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/Stmt.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,8 @@ class alignas(void *) Stmt {
593593

594594
unsigned : NumExprBits;
595595

596-
// These don't need to be particularly wide, because they're
597-
// strictly limited by the forms of expressions we permit.
598-
unsigned NumSubExprs : 8;
599-
unsigned ResultIndex : 32 - 8 - NumExprBits;
596+
unsigned NumSubExprs : 16;
597+
unsigned ResultIndex : 16;
600598
};
601599

602600
class SourceLocExprBitfields {

clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,15 +544,11 @@ class Environment {
544544

545545
/// Record a fact that must be true if this point in the program is reached.
546546
void addToFlowCondition(const Formula &);
547-
/// Deprecated: Use Formula version instead.
548-
void addToFlowCondition(BoolValue &Val);
549547

550548
/// Returns true if the formula is always true when this point is reached.
551549
/// Returns false if the formula may be false, or if the flow condition isn't
552550
/// sufficiently precise to prove that it is true.
553551
bool flowConditionImplies(const Formula &) const;
554-
/// Deprecated: Use Formula version instead.
555-
bool flowConditionImplies(BoolValue &Val) const;
556552

557553
/// Returns the `DeclContext` of the block being analysed, if any. Otherwise,
558554
/// returns null.

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ BUILTIN(__builtin_arm_rbit, "UiUi", "nc")
3939
BUILTIN(__builtin_arm_rbit64, "WUiWUi", "nc")
4040
BUILTIN(__builtin_arm_cls, "UiZUi", "nc")
4141
BUILTIN(__builtin_arm_cls64, "UiWUi", "nc")
42+
BUILTIN(__builtin_arm_clz, "UiZUi", "nc")
43+
BUILTIN(__builtin_arm_clz64, "UiWUi", "nc")
4244

4345
// HINT
4446
BUILTIN(__builtin_arm_nop, "v", "")

clang/include/clang/Basic/BuiltinsARM.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ BUILTIN(__builtin_arm_smusdx, "iii", "nc")
119119

120120
// Bit manipulation
121121
BUILTIN(__builtin_arm_rbit, "UiUi", "nc")
122+
BUILTIN(__builtin_arm_clz, "UiZUi", "nc")
123+
BUILTIN(__builtin_arm_clz64, "UiWUi", "nc")
122124
BUILTIN(__builtin_arm_cls, "UiZUi", "nc")
123125
BUILTIN(__builtin_arm_cls64, "UiWUi", "nc")
124126

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ class CodeGenOptions : public CodeGenOptionsBase {
5555
};
5656

5757
enum VectorLibrary {
58-
NoLibrary, // Don't use any vector library.
59-
Accelerate, // Use the Accelerate framework.
60-
LIBMVEC, // GLIBC vector math library.
61-
MASSV, // IBM MASS vector library.
62-
SVML, // Intel short vector math library.
63-
SLEEF, // SLEEF SIMD Library for Evaluating Elementary Functions.
64-
Darwin_libsystem_m // Use Darwin's libsytem_m vector functions.
58+
NoLibrary, // Don't use any vector library.
59+
Accelerate, // Use the Accelerate framework.
60+
LIBMVEC, // GLIBC vector math library.
61+
MASSV, // IBM MASS vector library.
62+
SVML, // Intel short vector math library.
63+
SLEEF, // SLEEF SIMD Library for Evaluating Elementary Functions.
64+
Darwin_libsystem_m, // Use Darwin's libsytem_m vector functions.
65+
ArmPL // Arm Performance Libraries.
6566
};
6667

6768
enum ObjCDispatchMethodKind {

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6249,8 +6249,6 @@ def note_enters_block_captures_non_trivial_c_struct : Note<
62496249
"to destroy">;
62506250
def note_enters_compound_literal_scope : Note<
62516251
"jump enters lifetime of a compound literal that is non-trivial to destruct">;
6252-
def note_enters_statement_expression : Note<
6253-
"jump enters a statement expression">;
62546252

62556253
def note_exits_cleanup : Note<
62566254
"jump exits scope of variable with __attribute__((cleanup))">;

clang/include/clang/Basic/riscv_vector.td

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,19 @@ multiclass RVVFloatingBinBuiltinSet
226226
[["vv", "v", "vvv"],
227227
["vf", "v", "vve"]]>;
228228

229+
multiclass RVVFloatingBinBuiltinSetRoundingMode
230+
: RVVOutOp1BuiltinSet<NAME, "xfd",
231+
[["vv", "v", "vvvu"],
232+
["vf", "v", "vveu"]]>;
233+
229234
multiclass RVVFloatingBinVFBuiltinSet
230235
: RVVOutOp1BuiltinSet<NAME, "xfd",
231236
[["vf", "v", "vve"]]>;
232237

238+
multiclass RVVFloatingBinVFBuiltinSetRoundingMode
239+
: RVVOutOp1BuiltinSet<NAME, "xfd",
240+
[["vf", "v", "vveu"]]>;
241+
233242
multiclass RVVFloatingMaskOutBuiltinSet
234243
: RVVOp0Op1BuiltinSet<NAME, "xfd",
235244
[["vv", "vm", "mvv"],
@@ -1856,12 +1865,77 @@ let ManualCodegen = [{
18561865
defm vnclipu : RVVUnsignedNShiftBuiltinSetRoundingMode;
18571866
defm vnclip : RVVSignedNShiftBuiltinSetRoundingMode;
18581867
}
1868+
}
18591869

18601870
// 14. Vector Floating-Point Instructions
1861-
// 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions
1862-
defm vfadd : RVVFloatingBinBuiltinSet;
1863-
defm vfsub : RVVFloatingBinBuiltinSet;
1864-
defm vfrsub : RVVFloatingBinVFBuiltinSet;
1871+
let HeaderCode =
1872+
[{
1873+
enum __RISCV_FRM {
1874+
__RISCV_FRM_RNE = 0,
1875+
__RISCV_FRM_RTZ = 1,
1876+
__RISCV_FRM_RDN = 2,
1877+
__RISCV_FRM_RUP = 3,
1878+
__RISCV_FRM_RMM = 4,
1879+
};
1880+
}] in def frm_enum : RVVHeader;
1881+
1882+
let UnMaskedPolicyScheme = HasPassthruOperand in {
1883+
let ManualCodegen = [{
1884+
{
1885+
// LLVM intrinsic
1886+
// Unmasked: (passthru, op0, op1, round_mode, vl)
1887+
// Masked: (passthru, vector_in, vector_in/scalar_in, mask, frm, vl, policy)
1888+
1889+
SmallVector<llvm::Value*, 7> Operands;
1890+
bool HasMaskedOff = !(
1891+
(IsMasked && (PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) ||
1892+
(!IsMasked && PolicyAttrs & RVV_VTA));
1893+
bool HasRoundModeOp = IsMasked ?
1894+
(HasMaskedOff ? Ops.size() == 6 : Ops.size() == 5) :
1895+
(HasMaskedOff ? Ops.size() == 5 : Ops.size() == 4);
1896+
1897+
unsigned Offset = IsMasked ?
1898+
(HasMaskedOff ? 2 : 1) : (HasMaskedOff ? 1 : 0);
1899+
1900+
if (!HasMaskedOff)
1901+
Operands.push_back(llvm::PoisonValue::get(ResultType));
1902+
else
1903+
Operands.push_back(Ops[IsMasked ? 1 : 0]);
1904+
1905+
Operands.push_back(Ops[Offset]); // op0
1906+
Operands.push_back(Ops[Offset + 1]); // op1
1907+
1908+
if (IsMasked)
1909+
Operands.push_back(Ops[0]); // mask
1910+
1911+
if (HasRoundModeOp) {
1912+
Operands.push_back(Ops[Offset + 2]); // frm
1913+
Operands.push_back(Ops[Offset + 3]); // vl
1914+
} else {
1915+
Operands.push_back(ConstantInt::get(Ops[Offset + 2]->getType(), 7)); // frm
1916+
Operands.push_back(Ops[Offset + 2]); // vl
1917+
}
1918+
1919+
if (IsMasked)
1920+
Operands.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs));
1921+
1922+
IntrinsicTypes = {ResultType, Ops[Offset + 1]->getType(),
1923+
Operands.back()->getType()};
1924+
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
1925+
return Builder.CreateCall(F, Operands, "");
1926+
}
1927+
}] in {
1928+
let HasFRMRoundModeOp = true in {
1929+
// 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions
1930+
defm vfadd : RVVFloatingBinBuiltinSetRoundingMode;
1931+
defm vfsub : RVVFloatingBinBuiltinSetRoundingMode;
1932+
defm vfrsub : RVVFloatingBinVFBuiltinSetRoundingMode;
1933+
}
1934+
// 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions
1935+
defm vfadd : RVVFloatingBinBuiltinSet;
1936+
defm vfsub : RVVFloatingBinBuiltinSet;
1937+
defm vfrsub : RVVFloatingBinVFBuiltinSet;
1938+
}
18651939

18661940
// 14.3. Vector Widening Floating-Point Add/Subtract Instructions
18671941
// Widening FP add/subtract, 2*SEW = SEW +/- SEW

clang/include/clang/Basic/riscv_vector_common.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ class RVVBuiltin<string suffix, string prototype, string type_range,
234234

235235
// Set to true if the builtin is associated with tuple types.
236236
bit IsTuple = false;
237+
238+
// Set to true if the builtin has a parameter that models floating-point
239+
// rounding mode control
240+
bit HasFRMRoundModeOp = false;
237241
}
238242

239243
// This is the code emitted in the header.

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,10 +2671,10 @@ def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_
26712671
Alias<fno_global_isel>;
26722672
def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
26732673
HelpText<"Use the given vector functions library">,
2674-
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,none">,
2674+
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,none">,
26752675
NormalizedValuesScope<"CodeGenOptions">,
26762676
NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
2677-
"Darwin_libsystem_m", "NoLibrary"]>,
2677+
"Darwin_libsystem_m", "ArmPL", "NoLibrary"]>,
26782678
MarshallingInfoEnum<CodeGenOpts<"VecLib">, "NoLibrary">;
26792679
def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
26802680
Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;

clang/include/clang/Support/RISCVVIntrinsicUtils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ class RVVIntrinsic {
387387
std::vector<int64_t> IntrinsicTypes;
388388
unsigned NF = 1;
389389
Policy PolicyAttrs;
390+
bool HasFRMRoundModeOp;
390391

391392
public:
392393
RVVIntrinsic(llvm::StringRef Name, llvm::StringRef Suffix,
@@ -397,7 +398,7 @@ class RVVIntrinsic {
397398
const RVVTypes &Types,
398399
const std::vector<int64_t> &IntrinsicTypes,
399400
const std::vector<llvm::StringRef> &RequiredFeatures,
400-
unsigned NF, Policy PolicyAttrs);
401+
unsigned NF, Policy PolicyAttrs, bool HasFRMRoundModeOp);
401402
~RVVIntrinsic() = default;
402403

403404
RVVTypePtr getOutputType() const { return OutputType; }
@@ -467,7 +468,7 @@ class RVVIntrinsic {
467468
static void updateNamesAndPolicy(bool IsMasked, bool HasPolicy,
468469
std::string &Name, std::string &BuiltinName,
469470
std::string &OverloadedName,
470-
Policy &PolicyAttrs);
471+
Policy &PolicyAttrs, bool HasFRMRoundModeOp);
471472
};
472473

473474
// RVVRequire should be sync'ed with target features, but only
@@ -526,6 +527,7 @@ struct RVVIntrinsicRecord {
526527
bool HasMaskedOffOperand : 1;
527528
bool HasTailPolicy : 1;
528529
bool HasMaskPolicy : 1;
530+
bool HasFRMRoundModeOp : 1;
529531
bool IsTuple : 1;
530532
uint8_t UnMaskedPolicyScheme : 2;
531533
uint8_t MaskedPolicyScheme : 2;

clang/lib/ARCMigrate/TransProperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace {
4545
class PropertiesRewriter {
4646
MigrationContext &MigrateCtx;
4747
MigrationPass &Pass;
48-
ObjCImplementationDecl *CurImplD;
48+
ObjCImplementationDecl *CurImplD = nullptr;
4949

5050
enum PropActionKind {
5151
PropAction_None,

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ namespace {
583583
/// LambdaCaptureFields - Mapping from captured variables/this to
584584
/// corresponding data members in the closure class.
585585
llvm::DenseMap<const ValueDecl *, FieldDecl *> LambdaCaptureFields;
586-
FieldDecl *LambdaThisCaptureField;
586+
FieldDecl *LambdaThisCaptureField = nullptr;
587587

588588
CallStackFrame(EvalInfo &Info, SourceLocation CallLoc,
589589
const FunctionDecl *Callee, const LValue *This,

clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -894,16 +894,10 @@ const StorageLocation &Environment::skip(const StorageLocation &Loc,
894894
void Environment::addToFlowCondition(const Formula &Val) {
895895
DACtx->addFlowConditionConstraint(FlowConditionToken, Val);
896896
}
897-
void Environment::addToFlowCondition(BoolValue &Val) {
898-
addToFlowCondition(Val.formula());
899-
}
900897

901898
bool Environment::flowConditionImplies(const Formula &Val) const {
902899
return DACtx->flowConditionImplies(FlowConditionToken, Val);
903900
}
904-
bool Environment::flowConditionImplies(BoolValue &Val) const {
905-
return flowConditionImplies(Val.formula());
906-
}
907901

908902
void Environment::dump(raw_ostream &OS) const {
909903
// FIXME: add printing for remaining fields and allow caller to decide what

0 commit comments

Comments
 (0)