Skip to content

Commit a2173ce

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:68ed1728bf45162187a2b54eed226097b8fc0a12 into amd-gfx:f0ff55b15e04
Local branch amd-gfx f0ff55b Merged main:784e0cf2d980cdf0f63d3dba722389c5a556cda4 into amd-gfx:0033134a6ded Remote branch main 68ed172 [VPlan] Unify mayWriteToMemory and mayHaveSideEffects logic for VPInst.
2 parents f0ff55b + 68ed172 commit a2173ce

File tree

76 files changed

+5214
-2724
lines changed

Some content is hidden

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

76 files changed

+5214
-2724
lines changed

clang/test/Driver/cl-options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@
406406
// RUN: /Zm \
407407
// RUN: /Zo \
408408
// RUN: /Zo- \
409-
// RUN: -### -- %s 2>&1 | FileCheck -check-prefix=IGNORED %s
409+
// RUN: -### -- %s 2>&1 | FileCheck -DMSG=%errc_ENOENT -check-prefix=IGNORED %s
410410
// IGNORED-NOT: argument unused during compilation
411-
// IGNORED-NOT: no such file or directory
411+
// IGNORED-NOT: [[MSG]]
412412
// Don't confuse /openmp- with the /o flag:
413413
// IGNORED-NOT: "-o" "penmp-.obj"
414414

clang/test/Driver/cl-zc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@
133133
// RUN: /Zc:inline \
134134
// RUN: /Zc:rvalueCast \
135135
// RUN: /Zc:ternary \
136-
// RUN: -### -- %s 2>&1 | FileCheck -check-prefix=IGNORED %s
136+
// RUN: -### -- %s 2>&1 | FileCheck -DMSG=%errc_ENOENT -check-prefix=IGNORED %s
137137
// IGNORED-NOT: argument unused during compilation
138-
// IGNORED-NOT: no such file or directory
138+
// IGNORED-NOT: [[MSG]]
139139

140140
// Negated form warns:
141141
// RUN: %clang_cl /c \

clang/test/Driver/config-file-errs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
//--- Argument of '--config' must be existing file, if it is specified by path.
88
//
9-
// RUN: not %clang --config somewhere/nonexistent-config-file 2>&1 | FileCheck %s -check-prefix CHECK-NONEXISTENT
10-
// CHECK-NONEXISTENT: configuration file '{{.*}}somewhere{{.}}nonexistent-config-file' cannot be opened: {{[Nn]}}o such file or directory
9+
// RUN: not %clang --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT
10+
// CHECK-NONEXISTENT: configuration file '{{.*}}somewhere{{.}}nonexistent-config-file' cannot be opened: [[MSG]]
1111

1212

1313
//--- All '--config' arguments must be existing files.
1414
//
15-
// RUN: not %clang --config %S/Inputs/config-4.cfg --config somewhere/nonexistent-config-file 2>&1 | FileCheck %s -check-prefix CHECK-NONEXISTENT
15+
// RUN: not %clang --config %S/Inputs/config-4.cfg --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT
1616

1717

1818
//--- Argument of '--config' must exist somewhere in well-known directories, if it is specified by bare name.

clang/test/Driver/response-file-errs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
// If file in `@file` is a directory, it is an error.
1313
//
14-
// RUN: not %clang @%S/Inputs -### 2>&1 | FileCheck --check-prefix=DIRECTORY %s
15-
// DIRECTORY: cannot not open file '{{.*}}Inputs': {{[Ii]}}s a directory
14+
// RUN: not %clang @%S/Inputs -### 2>&1 | FileCheck -DMSG=%errc_EISDIR --check-prefix=DIRECTORY %s
15+
// DIRECTORY: cannot not open file '{{.*}}Inputs': [[MSG]]

compiler-rt/lib/rtsan/rtsan.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "sanitizer_common/sanitizer_atomic.h"
1919
#include "sanitizer_common/sanitizer_common.h"
2020
#include "sanitizer_common/sanitizer_mutex.h"
21+
#include "sanitizer_common/sanitizer_stackdepot.h"
2122
#include "sanitizer_common/sanitizer_stacktrace.h"
2223

2324
using namespace __rtsan;
@@ -49,7 +50,30 @@ static auto OnViolationAction(DiagnosticsInfo info) {
4950
return [info]() {
5051
IncrementTotalErrorCount();
5152

52-
PrintDiagnostics(info);
53+
BufferedStackTrace stack;
54+
55+
// We use the unwind_on_fatal flag here because of precedent with other
56+
// sanitizers, this action is not necessarily fatal if halt_on_error=false
57+
stack.Unwind(info.pc, info.bp, nullptr,
58+
common_flags()->fast_unwind_on_fatal);
59+
60+
// If in the future we interop with other sanitizers, we will
61+
// need to make our own stackdepot
62+
StackDepotHandle handle = StackDepotPut_WithHandle(stack);
63+
64+
const bool is_stack_novel = handle.use_count() == 0;
65+
66+
// Marked UNLIKELY as if user is runing with halt_on_error=false
67+
// we expect a high number of duplicate stacks. We are willing
68+
// To pay for the first insertion.
69+
if (UNLIKELY(is_stack_novel)) {
70+
IncrementUniqueErrorCount();
71+
72+
PrintDiagnostics(info);
73+
stack.Print();
74+
75+
handle.inc_use_count_unsafe();
76+
}
5377

5478
if (flags().halt_on_error)
5579
Die();

compiler-rt/lib/rtsan/rtsan_diagnostics.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ class Decorator : public __sanitizer::SanitizerCommonDecorator {
3939
};
4040
} // namespace
4141

42-
static void PrintStackTrace(uptr pc, uptr bp) {
43-
BufferedStackTrace stack{};
44-
45-
stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal);
46-
stack.Print();
47-
}
48-
4942
static void PrintError(const Decorator &decorator,
5043
const DiagnosticsInfo &info) {
5144
const auto ErrorTypeStr = [&info]() -> const char * {
@@ -91,5 +84,4 @@ void __rtsan::PrintDiagnostics(const DiagnosticsInfo &info) {
9184
PrintError(d, info);
9285
PrintReason(d, info);
9386
Printf("%s", d.Default());
94-
PrintStackTrace(info.pc, info.bp);
9587
}

compiler-rt/lib/rtsan/rtsan_stats.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,27 @@ using namespace __sanitizer;
1919
using namespace __rtsan;
2020

2121
static atomic_uint32_t rtsan_total_error_count{0};
22+
static atomic_uint32_t rtsan_unique_error_count{0};
2223

2324
void __rtsan::IncrementTotalErrorCount() {
2425
atomic_fetch_add(&rtsan_total_error_count, 1, memory_order_relaxed);
2526
}
2627

28+
void __rtsan::IncrementUniqueErrorCount() {
29+
atomic_fetch_add(&rtsan_unique_error_count, 1, memory_order_relaxed);
30+
}
31+
2732
static u32 GetTotalErrorCount() {
2833
return atomic_load(&rtsan_total_error_count, memory_order_relaxed);
2934
}
3035

36+
static u32 GetUniqueErrorCount() {
37+
return atomic_load(&rtsan_unique_error_count, memory_order_relaxed);
38+
}
39+
3140
void __rtsan::PrintStatisticsSummary() {
3241
ScopedErrorReportLock l;
3342
Printf("RealtimeSanitizer exit stats:\n");
3443
Printf(" Total error count: %u\n", GetTotalErrorCount());
44+
Printf(" Unique error count: %u\n", GetUniqueErrorCount());
3545
}

compiler-rt/lib/rtsan/rtsan_stats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
namespace __rtsan {
1616

1717
void IncrementTotalErrorCount();
18+
void IncrementUniqueErrorCount();
1819

1920
void PrintStatisticsSummary();
2021

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// RUN: %clangxx -fsanitize=realtime %s -o %t
2+
// RUN: env RTSAN_OPTIONS="halt_on_error=false,print_stats_on_exit=true" %run %t 2>&1 | FileCheck %s
3+
4+
// UNSUPPORTED: ios
5+
6+
// Intent: Ensure all errors are deduplicated.
7+
8+
#include <unistd.h>
9+
10+
const int kNumViolations = 10;
11+
12+
void violation() [[clang::nonblocking]] {
13+
for (int i = 0; i < kNumViolations; i++)
14+
usleep(1);
15+
}
16+
17+
void violation2() [[clang::nonblocking]] {
18+
for (int i = 0; i < kNumViolations; i++)
19+
violation();
20+
}
21+
22+
void double_violation() [[clang::nonblocking]] {
23+
violation();
24+
violation2();
25+
}
26+
27+
int main() {
28+
violation(); // 1 unique errors here, but 10 total
29+
violation2(); // 1 unique errors here, but 100 total
30+
double_violation(); // 2 unique errors here, but 110 total
31+
return 0;
32+
}
33+
34+
// CHECK-COUNT-4: ==ERROR:
35+
// CHECK-NOT: ==ERROR:
36+
37+
// CHECK: RealtimeSanitizer exit stats:
38+
// CHECK-NEXT: Total error count: 220
39+
// CHECK-NEXT: Unique error count: 4

compiler-rt/test/rtsan/exit_stats.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ int main() {
2121

2222
// CHECK: RealtimeSanitizer exit stats:
2323
// CHECK-NEXT: Total error count: 10
24+
// CHECK-NEXT: Unique error count: 1

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ void OmpStructureChecker::Leave(const parser::OmpDeclareTargetWithClause &x) {
12471247
FindClause(llvm::omp::Clause::OMPC_link);
12481248
if (!enterClause && !toClause && !linkClause) {
12491249
context_.Say(x.source,
1250-
"If the DECLARE TARGET directive has a clause, it must contain at lease one ENTER clause or LINK clause"_err_en_US);
1250+
"If the DECLARE TARGET directive has a clause, it must contain at least one ENTER clause or LINK clause"_err_en_US);
12511251
}
12521252
if (toClause && context_.ShouldWarn(common::UsageWarning::OpenMPUsage)) {
12531253
context_.Say(toClause->source,

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ set(files
687687
__ranges/views.h
688688
__ranges/zip_view.h
689689
__split_buffer
690-
__std_clang_module
691690
__std_mbstate_t.h
692691
__stop_token/atomic_unique_lock.h
693692
__stop_token/intrusive_list_view.h

libcxx/include/__format/formatter_integral.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <__type_traits/make_unsigned.h>
2828
#include <__utility/unreachable.h>
2929
#include <array>
30+
#include <cstdint>
3031
#include <limits>
3132
#include <string>
3233
#include <string_view>

0 commit comments

Comments
 (0)