Skip to content

Commit 5a38474

Browse files
authored
Merge branch 'main' into fix/163498
2 parents 02b7095 + 5b2f9b5 commit 5a38474

File tree

252 files changed

+33285
-3094
lines changed

Some content is hidden

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

252 files changed

+33285
-3094
lines changed

.github/workflows/llvm-bugs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
url : issue.data.html_url,
5353
labels : issue.data.labels.map((label) => label.name),
5454
assignee : issue.data.assignees.map((assignee) => assignee.login),
55-
body : issue.data.body
55+
body : maybeTruncatedBody
5656
};
5757
5858
const data = {

bolt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Once you have `perf.fdata` ready, you can use it for optimizations with
173173
BOLT. Assuming your environment is setup to include the right path, execute
174174
`llvm-bolt`:
175175
```
176-
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions -split-all-cold -split-eh -dyno-stats
176+
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions -split-all-cold -split-eh -dyno-stats
177177
```
178178

179179
If you do need an updated debug info, then add `-update-debug-sections` option

bolt/docs/CommandLineArgumentReference.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,6 @@
381381

382382
Set verbosity level for diagnostic output
383383

384-
- `--write-dwp`
385-
386-
Output a single dwarf package file (dwp) instead of multiple non-relocatable
387-
dwarf object files (dwo).
388-
389384
### BOLT optimization options:
390385

391386
- `--align-blocks`

bolt/lib/Core/BinaryContext.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ cl::opt<std::string> CompDirOverride(
7878
"to *.dwo files."),
7979
cl::Hidden, cl::init(""), cl::cat(BoltCategory));
8080

81+
static cl::opt<bool> CloneConstantIsland("clone-constant-island",
82+
cl::desc("clone constant islands"),
83+
cl::Hidden, cl::init(true),
84+
cl::ZeroOrMore, cl::cat(BoltCategory));
85+
8186
static cl::opt<bool>
8287
FailOnInvalidPadding("fail-on-invalid-padding", cl::Hidden, cl::init(false),
8388
cl::desc("treat invalid code padding as error"),
@@ -461,14 +466,21 @@ BinaryContext::handleAddressRef(uint64_t Address, BinaryFunction &BF,
461466
// of dynamic relocs, as we currently do not support cloning them.
462467
// Notice: we might fail to link because of this, if the original constant
463468
// island we are referring would be emitted too far away.
464-
if (IslandIter->second->hasDynamicRelocationAtIsland()) {
469+
if (IslandIter->second->hasDynamicRelocationAtIsland() ||
470+
!opts::CloneConstantIsland) {
465471
MCSymbol *IslandSym =
466472
IslandIter->second->getOrCreateIslandAccess(Address);
467473
if (IslandSym)
468474
return std::make_pair(IslandSym, 0);
469475
} else if (MCSymbol *IslandSym =
470476
IslandIter->second->getOrCreateProxyIslandAccess(Address,
471477
BF)) {
478+
LLVM_DEBUG(
479+
dbgs() << "BOLT-DEBUG: clone constant island at address 0x"
480+
<< Twine::utohexstr(IslandIter->first) << " with size of 0x"
481+
<< Twine::utohexstr(
482+
IslandIter->second->estimateConstantIslandSize())
483+
<< " bytes, referenced by " << BF << "\n");
472484
BF.createIslandDependency(IslandSym, IslandIter->second);
473485
return std::make_pair(IslandSym, 0);
474486
}

bolt/test/X86/dwarf4-ftypes-dwp-input-dwp-output.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# UNSUPPORTED: true
1+
# REQUIRES: system-linux
22
; RUN: rm -rf %t
33
; RUN: mkdir %t
44
; RUN: cd %t
@@ -8,7 +8,8 @@
88
; RUN: llvm-dwp -e main.exe -o main.exe.dwp
99
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.dwp | FileCheck -check-prefix=PRE-BOLT %s
1010
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.dwp | FileCheck -check-prefix=PRE-BOLT-DWP-TU-INDEX %s
11-
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --write-dwp
11+
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
12+
; RUN: llvm-dwp -e main.exe.bolt -o main.exe.bolt.dwp
1213
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
1314
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s
1415

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ Improvements to Clang's diagnostics
395395
that were previously incorrectly accepted in case of other irrelevant
396396
conditions are now consistently diagnosed, identical to C++ mode.
397397

398+
- Fix false-positive unused label diagnostic when a label is used in a named break
399+
or continue (#GH166013)
398400
- Clang now emits a diagnostic in case `vector_size` or `ext_vector_type`
399401
attributes are used with a negative size (#GH165463).
400402

@@ -460,6 +462,7 @@ Bug Fixes to Attribute Support
460462
- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075)
461463
- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905)
462464
- Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function.
465+
- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110)
463466

464467
Bug Fixes to C++ Support
465468
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -504,6 +507,7 @@ Bug Fixes to C++ Support
504507
nontrivial member when another member has an initializer. (#GH81774)
505508
- Fixed a template depth issue when parsing lambdas inside a type constraint. (#GH162092)
506509
- Diagnose unresolved overload sets in non-dependent compound requirements. (#GH51246) (#GH97753)
510+
- Fix a crash when extracting unavailable member type from alias in template deduction. (#GH165560)
507511
- Fix incorrect diagnostics for lambdas with init-captures inside braced initializers. (#GH163498)
508512

509513
Bug Fixes to AST Handling

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,9 @@ def Xarch__
951951
the host system, which can be used to suppress incompatible GPU arguments.}]>,
952952
MetaVarName<"<arch> <arg>">;
953953
def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
954-
HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
954+
HelpText<"Pass <arg> to host compilation in the offloading toolchain">, MetaVarName<"<arg>">;
955955
def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,
956-
HelpText<"Pass <arg> to the CUDA/HIP device compilation">, MetaVarName<"<arg>">;
956+
HelpText<"Pass <arg> to device compilation in the offloading toolchain">, MetaVarName<"<arg>">;
957957
def Xassembler : Separate<["-"], "Xassembler">,
958958
HelpText<"Pass <arg> to the assembler">, MetaVarName<"<arg>">,
959959
Group<CompileOnly_Group>;

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,18 +3331,18 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
33313331
if (List.empty())
33323332
return;
33333333

3334-
llvm::PointerType *UnqualPtr =
3335-
llvm::PointerType::getUnqual(CGM.getLLVMContext());
3336-
33373334
// Convert List to what ConstantArray needs.
33383335
SmallVector<llvm::Constant*, 8> UsedArray;
33393336
UsedArray.resize(List.size());
33403337
for (unsigned i = 0, e = List.size(); i != e; ++i) {
3341-
UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
3342-
cast<llvm::Constant>(&*List[i]), UnqualPtr);
3338+
UsedArray[i] =
3339+
llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
3340+
cast<llvm::Constant>(&*List[i]), CGM.Int8PtrTy);
33433341
}
33443342

3345-
llvm::ArrayType *ATy = llvm::ArrayType::get(UnqualPtr, UsedArray.size());
3343+
if (UsedArray.empty())
3344+
return;
3345+
llvm::ArrayType *ATy = llvm::ArrayType::get(CGM.Int8PtrTy, UsedArray.size());
33463346

33473347
auto *GV = new llvm::GlobalVariable(
33483348
CGM.getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage,

clang/lib/Headers/module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ module _Builtin_stdbool [system] {
253253
export *
254254
}
255255

256+
module _Builtin_stdckdint [system] {
257+
header "stdckdint.h"
258+
export *
259+
}
260+
256261
module _Builtin_stdcountof [system] {
257262
header "stdcountof.h"
258263
export *

clang/lib/Lex/ModuleMap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ static bool isBuiltinHeaderName(StringRef FileName) {
258258
.Case("stdarg.h", true)
259259
.Case("stdatomic.h", true)
260260
.Case("stdbool.h", true)
261+
.Case("stdckdint.h", true)
261262
.Case("stdcountof.h", true)
262263
.Case("stddef.h", true)
263264
.Case("stdint.h", true)

0 commit comments

Comments
 (0)