Skip to content

Commit 691d11a

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3308)
2 parents f836642 + e489a44 commit 691d11a

File tree

302 files changed

+2604
-2261
lines changed

Some content is hidden

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

302 files changed

+2604
-2261
lines changed

.git-blame-ignore-revs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,40 @@ d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
106106
ce46adb8b7ce645353eccaedf31ed9765dab77bb
107107
68070f908bb7ac5f0b5fa9722caa504ecf723f6b
108108
5213c57cb1f0d78aad9a253b7f6a2b62ff4c7859
109+
110+
# [mlir] Update create method
111+
9e7834cadf48292b5d127d6d98f9e6d565ed5d9a
112+
284a5c2c0b97edddf255ea210f939203ad3d09f2
113+
c090ed53fb73f59cf221f5610430af8047758117
114+
fcbcfe44cff00101a6a98a73971398eb8dd87710
115+
258daf539583b80e0217d1d87941412d65cf16aa
116+
c610b244937ed847b0275ccb038c0f2d36310b4a
117+
b58ad3650f2195117f484d551ffbada27e7d1e14
118+
258d04c810ab10f101324cbf1fe3c7be65eb1938
119+
a6bf40d1c6cf010b3ad90bf7f410983453f4deb2
120+
dcfc853c51aecf6538182378c016f8e1604e7e97
121+
3f74334c38120bbdefac012d478dfce8e4eb0906
122+
a636b7bfdd1d8304b78e8b42ec900a21736d4afb
123+
75aa7065dcf653de7870758cd502a7c714f4bcd7
124+
2f5312563fd5cb2e355ec49109f3e63875337c7c
125+
967626b842551ecd997c0d10eb68c3015b63a3d7
126+
588845defd09359a8b87db339b563af848cf45a7
127+
b0434925c98c9a8906afea60a1304c870b1f574a
128+
8fff238b2c363b036ce9e7bf7abab3acafc87ab2
129+
38976a03cd367b27437e0d1e81c0ccaee2777b47
130+
eaa67a3cf041009ae33a45159d0465262c3af5dc
131+
b0312be6aa664e4cb9abec6d080e971493093d05
132+
2736fbd8324bf21a130c8abd4bd0e7d3aa840ac1
133+
4ae9fdca8af095afd91705f8dd143e93b304b6fb
134+
f904cdd6c3049e605d24ed17680e80e7133908a0
135+
972ac59c9af4ad47af0b3542ae936b3470727e5f
136+
7b787965431e666858fdf66db25ee5a129833927
137+
c3823af156b517d926a56e3d0d585e2a15720e96
138+
dce6679cf5cbbdaffb9c2b51dc762c5c6689ea78
139+
9844ba6d9740206129b52633c555f767eaa45581
140+
5547c6cd03ddddd405a09e51624e1f19955a85b1
141+
a3a007ad5fa20abc90ead4e1030b481bf109b4cf
142+
46f6df0848ea04449c6179ecdedc404ee5b5cf11
143+
b7e332d3f59f567b1999fbcc660d7837cba8e406
144+
6056f942abe83b05406df8b04e95ec37a3d160b5
145+
906295b8a31c8dac5aa845864c0bca9f02f86184

bolt/test/X86/debug-fission-single-convert.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
# RUN: -nostartfiles \
1515
# RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \
1616
# RUN: %t.o -o %t.exe
17+
# RUN: mkdir -p %t.dwarf-output
1718
# RUN: llvm-bolt %t.exe \
1819
# RUN: --reorder-blocks=reverse \
1920
# RUN: --update-debug-sections \
20-
# RUN: --dwarf-output-path=%T \
21+
# RUN: --dwarf-output-path=%t.dwarf-output \
2122
# RUN: --always-convert-to-ranges=true \
2223
# RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s
2324
# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
24-
# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest
25+
# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest
2526
# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
2627
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
2728

bolt/test/X86/debug-fission-single.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
# RUN: -nostartfiles \
1515
# RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \
1616
# RUN: %t.o -o %t.exe
17+
# RUN: mkdir -p %t.dwarf-output
1718
# RUN: llvm-bolt %t.exe \
1819
# RUN: --reorder-blocks=reverse \
1920
# RUN: --update-debug-sections \
20-
# RUN: --dwarf-output-path=%T \
21+
# RUN: --dwarf-output-path=%t.dwarf-output \
2122
# RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s
2223
# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
23-
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest
24+
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest
2425
# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
2526
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
2627

bolt/test/X86/inlined-function-mixed.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Make sure inlining from a unit with debug info into unit without
22
## debug info does not cause a crash.
33

4-
RUN: %clangxx %cxxflags %S/Inputs/inlined.cpp -c -o %T/inlined.o
5-
RUN: %clangxx %cxxflags %S/Inputs/inlinee.cpp -c -o %T/inlinee.o -g
6-
RUN: %clangxx %cxxflags %T/inlined.o %T/inlinee.o -o %t
4+
RUN: %clangxx %cxxflags %S/Inputs/inlined.cpp -c -o %t.inlined.o
5+
RUN: %clangxx %cxxflags %S/Inputs/inlinee.cpp -c -o %t.inlinee.o -g
6+
RUN: %clangxx %cxxflags %t.inlined.o %t.inlinee.o -o %t
77

88
RUN: llvm-bolt %t -o %t.bolt --update-debug-sections --reorder-blocks=reverse \
99
RUN: --inline-small-functions --force-inline=main | FileCheck %s

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ clang_target_link_libraries(clangTidyLLVMModule
2929
clangBasic
3030
clangLex
3131
clangTooling
32+
clangTransformer
3233
)

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ Non-comprehensive list of changes in this release
8989
-------------------------------------------------
9090
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
9191

92+
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for
93+
trapping into the generated debug info. This feature allows debuggers (e.g. LLDB) to display
94+
the reason for trapping if the trap is reached. The string is currently encoded in the debug
95+
info as an artificial frame that claims to be inlined at the trap location. The function used
96+
for the artificial frame is an artificial function whose name encodes the reason for trapping.
97+
The encoding used is currently the same as ``__builtin_verbose_trap`` but might change in the future.
98+
This feature is enabled by default but can be disabled by compiling with
99+
``-fno-sanitize-annotate-debug-info-traps``.
92100

93101
New Compiler Flags
94102
------------------
103+
- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
95104

96105
Deprecated Compiler Flags
97106
-------------------------

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ CODEGENOPT(SanitizeBinaryMetadataAtomics, 1, 0, Benign) ///< Emit PCs for atomic
307307
CODEGENOPT(SanitizeBinaryMetadataUAR, 1, 0, Benign) ///< Emit PCs for start of functions
308308
///< that are subject for use-after-return checking.
309309
CODEGENOPT(SanitizeStats , 1, 0, Benign) ///< Collect statistics for sanitizers.
310+
CODEGENOPT(SanitizeDebugTrapReasons, 1, 1 , Benign) ///< Enable UBSan trapping messages
310311
CODEGENOPT(SimplifyLibCalls , 1, 1, Benign) ///< Set when -fbuiltin is enabled.
311312
CODEGENOPT(SoftFloat , 1, 0, Benign) ///< -soft-float.
312313
CODEGENOPT(SpeculativeLoadHardening, 1, 0, Benign) ///< Enable speculative load hardening.

clang/include/clang/Driver/Options.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,16 @@ def fsanitize_undefined_trap_on_error
26062606
def fno_sanitize_undefined_trap_on_error
26072607
: Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group<f_clang_Group>,
26082608
Alias<fno_sanitize_trap_EQ>, AliasArgs<["undefined"]>;
2609+
defm sanitize_debug_trap_reasons
2610+
: BoolFOption<
2611+
"sanitize-debug-trap-reasons",
2612+
CodeGenOpts<"SanitizeDebugTrapReasons">, DefaultTrue,
2613+
PosFlag<SetTrue, [], [ClangOption, CC1Option],
2614+
"Annotate trap blocks in debug info with UBSan trap reasons">,
2615+
NegFlag<SetFalse, [], [ClangOption, CC1Option],
2616+
"Do not annotate trap blocks in debug info with UBSan trap "
2617+
"reasons">>;
2618+
26092619
defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
26102620
CodeGenOpts<"SanitizeMinimalRuntime">, DefaultFalse,
26112621
PosFlag<SetTrue>,

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,12 +1027,6 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10271027
MPM.addPass(
10281028
createModuleToFunctionPassAdaptor(ObjCARCExpandPass()));
10291029
});
1030-
PB.registerPipelineEarlySimplificationEPCallback(
1031-
[](ModulePassManager &MPM, OptimizationLevel Level,
1032-
ThinOrFullLTOPhase) {
1033-
if (Level != OptimizationLevel::O0)
1034-
MPM.addPass(ObjCARCAPElimPass());
1035-
});
10361030
PB.registerScalarOptimizerLateEPCallback(
10371031
[](FunctionPassManager &FPM, OptimizationLevel Level) {
10381032
if (Level != OptimizationLevel::O0)

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7009,7 +7009,7 @@ CodeGenFunction::LexicalScope::~LexicalScope() {
70097009
static std::string SanitizerHandlerToCheckLabel(SanitizerHandler Handler) {
70107010
std::string Label;
70117011
switch (Handler) {
7012-
#define SANITIZER_CHECK(Enum, Name, Version) \
7012+
#define SANITIZER_CHECK(Enum, Name, Version, Msg) \
70137013
case Enum: \
70147014
Label = "__ubsan_check_" #Name; \
70157015
break;

0 commit comments

Comments
 (0)