Skip to content

Commit 9119292

Browse files
authored
merge main into amd-staging (llvm#768)
2 parents d88b8e6 + ac757ff commit 9119292

File tree

301 files changed

+9994
-3210
lines changed

Some content is hidden

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

301 files changed

+9994
-3210
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
**/crash_diagnostics/*
125125
stage3:
126126
if: github.repository_owner == 'llvm'
127-
needs: [ stage1, stage2 ]
127+
needs: [ stage2 ]
128128
continue-on-error: false
129129
strategy:
130130
fail-fast: false
@@ -188,7 +188,7 @@ jobs:
188188
**/crash_diagnostics/*
189189
190190
macos:
191-
needs: [ stage1 ]
191+
needs: [ stage3 ]
192192
strategy:
193193
fail-fast: false
194194
matrix:
@@ -232,7 +232,7 @@ jobs:
232232
233233
windows:
234234
runs-on: windows-2022
235-
needs: [ stage1 ]
235+
needs: [ stage2 ]
236236
strategy:
237237
fail-fast: false
238238
matrix:

bolt/lib/Passes/Inliner.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ ForceInlineFunctions("force-inline",
4949
cl::Hidden,
5050
cl::cat(BoltOptCategory));
5151

52+
static cl::list<std::string> SkipInlineFunctions(
53+
"skip-inline", cl::CommaSeparated,
54+
cl::desc("list of functions to never consider for inlining"),
55+
cl::value_desc("func1,func2,func3,..."), cl::Hidden,
56+
cl::cat(BoltOptCategory));
57+
5258
static cl::opt<bool> InlineAll("inline-all", cl::desc("inline all functions"),
5359
cl::cat(BoltOptCategory));
5460

@@ -105,6 +111,12 @@ bool mustConsider(const llvm::bolt::BinaryFunction &Function) {
105111
return false;
106112
}
107113

114+
bool mustSkip(const llvm::bolt::BinaryFunction &Function) {
115+
return llvm::any_of(opts::SkipInlineFunctions, [&](const std::string &Name) {
116+
return Function.hasName(Name);
117+
});
118+
}
119+
108120
void syncOptions() {
109121
if (opts::InlineIgnoreCFI)
110122
opts::InlineIgnoreLeafCFI = true;
@@ -223,7 +235,7 @@ InliningInfo getInliningInfo(const BinaryFunction &BF) {
223235
void Inliner::findInliningCandidates(BinaryContext &BC) {
224236
for (const auto &BFI : BC.getBinaryFunctions()) {
225237
const BinaryFunction &Function = BFI.second;
226-
if (!shouldOptimize(Function))
238+
if (!shouldOptimize(Function) || opts::mustSkip(Function))
227239
continue;
228240
const InliningInfo InlInfo = getInliningInfo(Function);
229241
if (InlInfo.Type != INL_NONE)

bolt/test/X86/skip-inline.s

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Check skip-inline flag behavior
2+
3+
# RUN: llvm-mc --filetype=obj --triple=x86_64-unknown-unknown %s -o %t.o
4+
# RUN: ld.lld %t.o -o %t.exe -q
5+
# RUN: llvm-bolt %t.exe --inline-small-functions --print-finalized --print-only=main \
6+
# RUN: -o %t.null | FileCheck %s --check-prefix=CHECK-INLINE
7+
# RUN: llvm-bolt %t.exe --inline-small-functions --skip-inline=foo --print-finalized \
8+
# RUN: --print-only=main -o %t.null | FileCheck %s --check-prefix=CHECK-NO-INLINE
9+
# CHECK-INLINE: Binary Function "main"
10+
# CHECK-INLINE: ud2
11+
# CHECK-NO-INLINE: Binary Function "main"
12+
# CHECK-NO-INLINE: callq foo
13+
14+
.globl _start
15+
_start:
16+
call main
17+
18+
.globl main
19+
main:
20+
call foo
21+
ret
22+
23+
.globl foo
24+
foo:
25+
ud2
26+
ret

clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s bugprone-chained-comparison %t
1+
// RUN: %check_clang_tidy --extra-arg=-Wno-error=parentheses %s bugprone-chained-comparison %t
22

33
void badly_chained_1(int x, int y, int z)
44
{

clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy -std=c++98-or-later %s bugprone-chained-comparison %t
1+
// RUN: %check_clang_tidy -std=c++98-or-later --extra-arg=-Wno-error=parentheses %s bugprone-chained-comparison %t
22

33
void badly_chained_1(int x, int y, int z)
44
{

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ Improvements to Clang's diagnostics
147147
- The ``-Wunsafe-buffer-usage`` warning has been updated to warn
148148
about unsafe libc function calls. Those new warnings are emitted
149149
under the subgroup ``-Wunsafe-buffer-usage-in-libc-call``.
150+
- Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
151+
``-Wno-error=parentheses``.
150152

151153
Improvements to Clang's time-trace
152154
----------------------------------
@@ -282,10 +284,6 @@ Code Completion
282284
Static Analyzer
283285
---------------
284286

285-
- Clang currently support extending lifetime of object bound to
286-
reference members of aggregates in CFG and ExprEngine, that are
287-
created from default member initializer.
288-
289287
New features
290288
^^^^^^^^^^^^
291289

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ def TruncF16F128 : Builtin, F16F128MathTemplate {
521521
let Prototype = "T(T)";
522522
}
523523

524+
def Sincospi : Builtin, FPMathTemplate {
525+
let Spellings = ["__builtin_sincospi"];
526+
let Attributes = [FunctionWithBuiltinPrefix, NoThrow];
527+
let Prototype = "void(T, T*, T*)";
528+
}
529+
524530
// Access to floating point environment.
525531
def BuiltinFltRounds : Builtin {
526532
let Spellings = ["__builtin_flt_rounds"];

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ def err_cpu_unsupported_isa
285285
def err_arch_unsupported_isa
286286
: Error<"architecture '%0' does not support '%1' execution mode">;
287287

288+
def err_zos_target_release_discontinued
289+
: Error<"z/OS target level \"%0\" is discontinued">;
290+
def err_zos_target_unrecognized_release
291+
: Error<"z/OS target level \"%0\" is invalid">;
292+
288293
def err_drv_I_dash_not_supported : Error<
289294
"'%0' not supported, please use -iquote instead">;
290295
def err_drv_unknown_argument : Error<"unknown argument: '%0'">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7126,7 +7126,7 @@ def note_precedence_conditional_first : Note<
71267126

71277127
def warn_consecutive_comparison : Warning<
71287128
"comparisons like 'X<=Y<=Z' don't have their mathematical meaning">,
7129-
InGroup<Parentheses>;
7129+
InGroup<Parentheses>, DefaultError;
71307130

71317131
def warn_enum_constant_in_bool_context : Warning<
71327132
"converting the enum constant to a boolean">,

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4849,6 +4849,7 @@ def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=
48494849
def march_EQ : Joined<["-"], "march=">, Group<m_Group>,
48504850
Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
48514851
HelpText<"For a list of available architectures for the target use '-mcpu=help'">;
4852+
def mzos_target_EQ : Joined<["-"], "mzos-target=">, Group<m_Group>, Visibility<[ClangOption, CC1Option]>, HelpText<"Set the z/OS release of the runtime environment">;
48524853
def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Visibility<[ClangOption, FlangOption]>;
48534854
def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>,
48544855
Visibility<[ClangOption, CC1Option]>,

0 commit comments

Comments
 (0)