Skip to content

Commit 2896b34

Browse files
committed
Merge branch 'main' into xegpu_simt_dist
2 parents 6ae7aa0 + e232d28 commit 2896b34

File tree

464 files changed

+10892
-6271
lines changed

Some content is hidden

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

464 files changed

+10892
-6271
lines changed

.ci/compute_projects.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"clang": {"clang-tools-extra", "compiler-rt", "cross-project-tests"},
5353
"clang-tools-extra": {"libc"},
5454
"mlir": {"flang"},
55+
# Test everything if ci scripts are changed.
56+
# FIXME: Figure out what is missing and add here.
57+
".ci": {"llvm", "clang", "lld", "lldb"},
5558
}
5659

5760
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
@@ -130,12 +133,11 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
130133
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
131134
projects_to_test = set()
132135
for modified_project in modified_projects:
133-
# Skip all projects where we cannot run tests.
134-
if modified_project not in PROJECT_CHECK_TARGETS:
135-
continue
136136
if modified_project in RUNTIMES:
137137
continue
138-
projects_to_test.add(modified_project)
138+
# Skip all projects where we cannot run tests.
139+
if modified_project in PROJECT_CHECK_TARGETS:
140+
projects_to_test.add(modified_project)
139141
if modified_project not in DEPENDENTS_TO_TEST:
140142
continue
141143
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:

.ci/compute_projects_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ def test_exclude_gn(self):
188188
self.assertEqual(env_variables["runtimes_to_build"], "")
189189
self.assertEqual(env_variables["runtimes_check_targets"], "")
190190

191+
def test_ci(self):
192+
env_variables = compute_projects.get_env_variables(
193+
[".ci/compute_projects.py"], "Linux"
194+
)
195+
self.assertEqual(env_variables["projects_to_build"], "clang;lld;llvm;lldb")
196+
self.assertEqual(
197+
env_variables["project_check_targets"],
198+
"check-clang check-lld check-llvm check-lldb",
199+
)
200+
self.assertEqual(
201+
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
202+
)
203+
self.assertEqual(
204+
env_variables["runtimes_check_targets"],
205+
"check-cxx check-cxxabi check-unwind",
206+
)
207+
191208

192209
if __name__ == "__main__":
193210
unittest.main()

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ ClangIR:
77
- clang/tools/cir-*/**/*
88
- clang/test/CIR/**/*
99

10+
clang:bytecode:
11+
- clang/docs/ConstantInterpreter.rst
12+
- clang/lib/AST/ByteCode/**/*
13+
- clang/test/AST/ByteCode/**/*
14+
- clang/unittests/AST/ByteCode/**/*
15+
1016
clang:dataflow:
1117
- clang/include/clang/Analysis/FlowSensitive/**/*
1218
- clang/lib/Analysis/FlowSensitive/**/*

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,10 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
373373
Streamer.emitLabel(StartSymbol);
374374
}
375375

376+
const bool NeedsFDE =
377+
Function.hasCFI() && !(Function.isPatch() && Function.isAnonymous());
376378
// Emit CFI start
377-
if (Function.hasCFI()) {
379+
if (NeedsFDE) {
378380
Streamer.emitCFIStartProc(/*IsSimple=*/false);
379381
if (Function.getPersonalityFunction() != nullptr)
380382
Streamer.emitCFIPersonality(Function.getPersonalityFunction(),
@@ -421,7 +423,7 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
421423
Streamer.emitBytes(BC.MIB->getTrapFillValue());
422424

423425
// Emit CFI end
424-
if (Function.hasCFI())
426+
if (NeedsFDE)
425427
Streamer.emitCFIEndProc();
426428

427429
MCSymbol *EndSymbol = Function.getFunctionEndLabel(FF.getFragmentNum());

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
555555
.addReg(RegCnt);
556556
}
557557

558-
InstructionListType createCmpJE(MCPhysReg RegNo, MCPhysReg RegTmp,
559-
const MCSymbol *Target,
560-
MCContext *Ctx) const {
558+
InstructionListType createRegCmpJE(MCPhysReg RegNo, MCPhysReg RegTmp,
559+
const MCSymbol *Target,
560+
MCContext *Ctx) const {
561561
InstructionListType Insts;
562562
Insts.emplace_back(
563563
MCInstBuilder(RISCV::SUB).addReg(RegTmp).addReg(RegNo).addReg(RegNo));
@@ -718,7 +718,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
718718
Insts.emplace_back();
719719
loadReg(Insts.back(), RISCV::X10, RISCV::X10, 0);
720720
InstructionListType cmpJmp =
721-
createCmpJE(RISCV::X10, RISCV::X11, IndCallHandler, Ctx);
721+
createRegCmpJE(RISCV::X10, RISCV::X11, IndCallHandler, Ctx);
722722
Insts.insert(Insts.end(), cmpJmp.begin(), cmpJmp.end());
723723
Insts.emplace_back();
724724
createStackPointerIncrement(Insts.back(), 16);
@@ -777,14 +777,13 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
777777
return createGetter(Ctx, "__bolt_instr_num_funcs");
778778
}
779779

780-
void convertIndirectCallToLoad(MCInst &Inst, MCPhysReg Reg,
781-
MCPhysReg ZeroReg) const {
780+
void convertIndirectCallToLoad(MCInst &Inst, MCPhysReg Reg) override {
782781
bool IsTailCall = isTailCall(Inst);
783782
if (IsTailCall)
784783
removeAnnotation(Inst, MCPlus::MCAnnotation::kTailCall);
785784
Inst.setOpcode(RISCV::ADD);
786785
Inst.insert(Inst.begin(), MCOperand::createReg(Reg));
787-
Inst.insert(Inst.begin() + 1, MCOperand::createReg(ZeroReg));
786+
Inst.insert(Inst.begin() + 1, MCOperand::createReg(RISCV::X0));
788787
return;
789788
}
790789

@@ -845,7 +844,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
845844
InstructionListType Insts;
846845
spillRegs(Insts, {RISCV::X10, RISCV::X11});
847846
Insts.emplace_back(CallInst);
848-
convertIndirectCallToLoad(Insts.back(), RISCV::X10, RISCV::X0);
847+
convertIndirectCallToLoad(Insts.back(), RISCV::X10);
849848
InstructionListType LoadImm = createLoadImmediate(RISCV::X11, CallSiteID);
850849
Insts.insert(Insts.end(), LoadImm.begin(), LoadImm.end());
851850
spillRegs(Insts, {RISCV::X10, RISCV::X11});

bolt/test/AArch64/lite-mode.s

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
# RUN: llvm-objdump -d --disassemble-symbols=cold_function %t.bolt \
1212
# RUN: | FileCheck %s
1313

14+
15+
## Verify that the number of FDEs matches the number of functions in the output
16+
## binary. There are three original functions and two optimized.
17+
# RUN: llvm-readelf -u %t.bolt | grep -wc FDE \
18+
# RUN: | FileCheck --check-prefix=CHECK-FDE %s
19+
# CHECK-FDE: 5
20+
1421
## In lite mode, optimized code will be separated from the original .text by
1522
## over 128MB, making it impossible for call/bl instructions in cold functions
1623
## to reach optimized functions directly.

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ set(LLVM_TOOLCHAIN_TOOLS
459459
llvm-libtool-darwin
460460
llvm-lipo
461461
llvm-ml
462+
llvm-mt
462463
llvm-nm
463464
llvm-objcopy
464465
llvm-objdump
@@ -480,10 +481,6 @@ set(LLVM_TOOLCHAIN_TOOLS
480481
scan-build-py
481482
CACHE STRING "")
482483

483-
if (LLVM_ENABLE_LIBXML2)
484-
list(APPEND LLVM_TOOLCHAIN_TOOLS llvm-mt)
485-
endif()
486-
487484
set(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
488485
bolt
489486
clang

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ C++ Language Changes
9696
asm((std::string_view("nop")) ::: (std::string_view("memory")));
9797
}
9898

99+
- Clang now implements the changes to overload resolution proposed by section 1 and 2 of
100+
`P3606 <https://wg21.link/P3606R0>`_. If a non-template candidate exists in an overload set that is
101+
a perfect match (all conversion sequences are identity conversions) template candidates are not instantiated.
102+
Diagnostics that would have resulted from the instantiation of these template candidates are no longer
103+
produced. This aligns Clang closer to the behavior of GCC, and fixes (#GH62096), (#GH74581), and (#GH74581).
104+
99105
C++2c Feature Support
100106
^^^^^^^^^^^^^^^^^^^^^
101107

@@ -385,6 +391,10 @@ Improvements to Clang's diagnostics
385391

386392
Fixes #GH131127
387393

394+
- ``-Wuninitialized`` now diagnoses when a class does not declare any
395+
constructors to initialize their non-modifiable members. The diagnostic is
396+
not new; being controlled via a warning group is what's new. Fixes #GH41104
397+
388398
Improvements to Clang's time-trace
389399
----------------------------------
390400

clang/include/clang/AST/RecordLayout.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ class ASTRecordLayout {
7575
// performance or backwards compatibility preserving (e.g. AIX-ABI).
7676
CharUnits PreferredAlignment;
7777

78-
// UnadjustedAlignment - Maximum of the alignments of the record members in
79-
// characters.
78+
// UnadjustedAlignment - Alignment of record in characters before alignment
79+
// adjustments. Maximum of the alignments of the record members and base
80+
// classes in characters.
8081
CharUnits UnadjustedAlignment;
8182

8283
/// RequiredAlignment - The required alignment of the object. In the MS-ABI
@@ -186,7 +187,7 @@ class ASTRecordLayout {
186187
CharUnits getPreferredAlignment() const { return PreferredAlignment; }
187188

188189
/// getUnadjustedAlignment - Get the record alignment in characters, before
189-
/// alignment adjustement.
190+
/// alignment adjustment.
190191
CharUnits getUnadjustedAlignment() const { return UnadjustedAlignment; }
191192

192193
/// getSize - Get the record size in characters.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,8 @@ def err_constructor_byvalue_arg : Error<
22662266
"copy constructor must pass its first argument by reference">;
22672267
def warn_no_constructor_for_refconst : Warning<
22682268
"%select{struct|interface|union|class|enum}0 %1 does not declare any "
2269-
"constructor to initialize its non-modifiable members">;
2269+
"constructor to initialize its non-modifiable members">,
2270+
InGroup<Uninitialized>;
22702271
def note_refconst_member_not_initialized : Note<
22712272
"%select{const|reference}0 member %1 will never be initialized">;
22722273
def ext_ms_explicit_constructor_call : ExtWarn<

0 commit comments

Comments
 (0)