[clang] [Clang][test] Relax checking for libclang_rt.asan.so and libclang_rt.asan_static.a on arm android. (PR #121361)

2024-12-30 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/121361 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][test] Relax checking for libclang_rt.asan.so and libclang_rt.asan_static.a on arm android. (PR #121361)

2024-12-30 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu created https://github.com/llvm/llvm-project/pull/121361 This fixes test breakage on clang bots. See comment https://github.com/llvm/llvm-project/pull/121081#issuecomment-2565933062 >From c2e29a1822a592cdd96b5f4e9efc3bbf2ef2bf95 Mon Sep 17 00:00:00 2001 From: Zequan

[clang] [NFC][Driver] Use global --implicit-check-not=libclang_rt (PR #121081)

2024-12-30 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Hi, we see this test failed on our clang bots, looks like we should relax the check log: ``` /b/s/w/ir/cache/builder/src/third_party/llvm/clang/test/Driver/sanitizer-ld.c:335:39: error: CHECK-ASAN-ANDROID-SHARED-LIBASAN: expected string not found in input // CHECK-ASAN-ANDROID

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-11-27 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Verified that it no longer crashes. https://github.com/llvm/llvm-project/pull/91991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c60b055 - Reapply "Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (#91991)"

2024-11-27 Thread Zequan Wu via cfe-commits
Author: Zequan Wu Date: 2024-11-27T11:18:05-08:00 New Revision: c60b055d463a3e9f18a494aec075f35d38d447a0 URL: https://github.com/llvm/llvm-project/commit/c60b055d463a3e9f18a494aec075f35d38d447a0 DIFF: https://github.com/llvm/llvm-project/commit/c60b055d463a3e9f18a494aec075f35d38d447a0.diff LOG

[clang] b05d37d - Revert "Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (#91991)"

2024-11-14 Thread Zequan Wu via cfe-commits
Author: Zequan Wu Date: 2024-11-14T13:43:59-08:00 New Revision: b05d37d0d25e5f3ef181e11eb2a61dd816ae72e1 URL: https://github.com/llvm/llvm-project/commit/b05d37d0d25e5f3ef181e11eb2a61dd816ae72e1 DIFF: https://github.com/llvm/llvm-project/commit/b05d37d0d25e5f3ef181e11eb2a61dd816ae72e1.diff LOG

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-11-14 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Confirmed that this change causes crash with -Wunsafe-buffer-usage: https://godbolt.org/z/vcv8d6sYr. My previously manual-reduced repro in https://github.com/llvm/llvm-project/pull/91991#issuecomment-2477311737 happens to crash before this change. https://github.com/llvm/llv

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-11-14 Thread Zequan Wu via cfe-commits
ZequanWu wrote: It's actually an existing crash not caused by this one. https://github.com/llvm/llvm-project/pull/91991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Respect the [[clang::unsafe_buffer_usage]] attribute for field and constructor initializers (PR #91991)

2024-11-14 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Hi, we have found this causing clang to crash with -Wunsafe-buffer-usage: https://godbolt.org/z/nvWxW43fK https://github.com/llvm/llvm-project/pull/91991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang] Avoid unnecessary call to clang::NamespaceDecl::isRedundantInlineQualifierFor(). (PR #115196)

2024-11-08 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/115196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid unnecessary call to clang::NamespaceDecl::isRedundantInlineQualifierFor(). (PR #115196)

2024-11-06 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/115196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid unnecessary call to clang::NamespaceDecl::isRedundantInlineQualifierFor(). (PR #115196)

2024-11-06 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu created https://github.com/llvm/llvm-project/pull/115196 We observed 2X slowdown in lldb's expression evaluation with https://github.com/llvm/llvm-project/pull/109147. It turns out that calling `isRedundantInlineQualifierFor` is quite expensive. Using short-circuit

[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-21 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Given there's already an implementation of `flock` in `compiler-rt/lib/profile/WindowsMMap.c`. Setting `COMPILER_RT_TARGET_HAS_FLOCK` according to this https://github.com/llvm/llvm-project/blob/7dc2542ac24fcae89dfd179fa58c4ec4fb959e2b/compiler-rt/lib/profile/CMakeLists.txt#L41-

[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-21 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Oh, I see, there are windows version of `flock` in `WindowsMMap.h`, and this new macro `COMPILER_RT_HAS_FLOCK` is defined here: [for linux](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/CMakeLists.txt#L41-L50) https://github.com/llvm/llvm-project/pull/1

[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-21 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Hi. this change caused chromium windows pgo build to fail: https://g-issues.chromium.org/issues/373478548 and we see the profile runtime error message: ``` LLVM Profile Error: Invalid profile data to merge LLVM Profile Error: Profile Merging of file default_16487515506031793746

[clang] [libcxx] [clang] Reland: Instantiate concepts with sugared template arguments (PR #101782)

2024-08-08 Thread Zequan Wu via cfe-commits
ZequanWu wrote: This change makes the following code no longer compile: ``` #include #include template concept CompatibleIter = std::contiguous_iterator; template class span { public: template requires(CompatibleIter) constexpr span(It first, int count) noexcept { } }; void f

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > > > > > Thanks for reporting. Those tests are failed due to not updated > > > > > properly. I relanded this change with updated tests: > > > > > [ae6dc64](https://github.com/llvm/llvm-project/commit/ae6dc64ec670891cb15049277e43133d4df7fb4b). > > > > > > > > > > > > Your upda

[clang] 6c375ae - Fix attr-nomerge.cpp with fixed triple

2024-08-01 Thread Zequan Wu via cfe-commits
Author: Zequan Wu Date: 2024-08-01T19:57:28-07:00 New Revision: 6c375ae7a4d97a9947fdc16be4d86e9eba3dde4c URL: https://github.com/llvm/llvm-project/commit/6c375ae7a4d97a9947fdc16be4d86e9eba3dde4c DIFF: https://github.com/llvm/llvm-project/commit/6c375ae7a4d97a9947fdc16be4d86e9eba3dde4c.diff LOG

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > > > Thanks for reporting. Those tests are failed due to not updated properly. > > > I relanded this change with updated tests: > > > [ae6dc64](https://github.com/llvm/llvm-project/commit/ae6dc64ec670891cb15049277e43133d4df7fb4b). > > > > > > Your updated change still seems t

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Thanks for reporting. Those tests are failed due to not updated properly. I relanded this change with updated tests: https://github.com/llvm/llvm-project/commit/ae6dc64ec670891cb15049277e43133d4df7fb4b. https://github.com/llvm/llvm-project/pull/101549 __

[clang] ae6dc64 - Reapply "[Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (#101549)"

2024-08-01 Thread Zequan Wu via cfe-commits
Author: Zequan Wu Date: 2024-08-01T15:54:50-07:00 New Revision: ae6dc64ec670891cb15049277e43133d4df7fb4b URL: https://github.com/llvm/llvm-project/commit/ae6dc64ec670891cb15049277e43133d4df7fb4b DIFF: https://github.com/llvm/llvm-project/commit/ae6dc64ec670891cb15049277e43133d4df7fb4b.diff LOG

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/101549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > Richard had a comment on the original which I think it still relevant: > > > There are 496 calls to Builder.CreateCall in clang's CodeGen. Do they all > > need this change? If not, how can we be confident we've found all the ones > > that do? (From a quick check, at least MSV

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/101549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Fix nomerge attribute not working with __builtin_trap(), __debugbreak(), __builtin_verbose_trap() (PR #101549)

2024-08-01 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu created https://github.com/llvm/llvm-project/pull/101549 1. It fixes the problem that llvm.trap() not getting the nomerge attribute. 2. It sets nomerge flag for the node if the instruction has nomerge arrtibute. This is a copy of https://reviews.llvm.org/D146164. Thi

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-29 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > > > @ZequanWu I can't successfully build your reproducer with clang trunk. > > > Would it be possible to provide the full test case or a fully reduced one? > > > > > > Because I reverted this change at > > [567b2c6](https://github.com/llvm/llvm-project/commit/567b2c608c307c0

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-29 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > @ZequanWu I can't successfully build your reproducer with clang trunk. Would > it be possible to provide the full test case or a fully reduced one? Because I reverted this change at https://github.com/llvm/llvm-project/commit/567b2c608c307c097315dd5ec4d6a5bbcddf898d, so it n

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-28 Thread Zequan Wu via cfe-commits
ZequanWu wrote: I have a partially reduced repro: ``` $ clang++ "-cc1" "-triple" "arm64-apple-macosx10.15.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-llvm-bc" "-flto=thin" "-flto-unit" "-disable-free" "-clear-a

[clang] Revert "[Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads" (PR #97002)

2024-06-27 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/97002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Reverting for now as this also breaks LLVM CI builder. https://github.com/llvm/llvm-project/pull/93113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads" (PR #97002)

2024-06-27 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/97002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads" (PR #97002)

2024-06-27 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu created https://github.com/llvm/llvm-project/pull/97002 Reverts llvm/llvm-project#93113 >From 62d7d5611e70682f8743e7322e34204480ffe189 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Fri, 28 Jun 2024 00:36:19 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"[Clang]=20Fix=2

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-27 Thread Zequan Wu via cfe-commits
ZequanWu wrote: This causes clang to crash when building chromium: ``` Assertion failed: (Loc.isValid() && "point of instantiation must be valid!"), function setPointOfInstantiation, file DeclTemplate.h, line 1938. PLEASE submit a bug report to https://crbug.com in the Tools>LLVM component, run

[clang] Add option to avoid generating coverage mappings for unused functions (PR #92582)

2024-05-23 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > The problem that this solves is related to binary size. In situations where a > large C API is in generated code but a small part of the API is used, the > size of __llvm_prf_names and __llvm_cov_fun sections can be prohibitively > large. This flag offers a way to reduce bina

[clang] Add option to avoid generating coverage mappings for unused functions (PR #92582)

2024-05-22 Thread Zequan Wu via cfe-commits
ZequanWu wrote: I think the main purpose for emitting coverage mapping for un-emitted functions is to tell llvm-cov that those functions are not executed at all, so it shows execution count 0 for them instead of not-covered. https://github.com/llvm/llvm-project/pull/92582 _

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #92527)

2024-05-21 Thread Zequan Wu via cfe-commits
@@ -27,6 +27,80 @@ class MemInit { C m = s; }; +namespace std { +typedef decltype(sizeof(int)) size_t; + +// libc++'s implementation +template class initializer_list { + const _E *__begin_; + size_t __size_; + + initializer_list(const _E *__b, size_t __s) : __begin_(__b)

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-16 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Here's a smaller repro of the `-Wuninitialized` warning: ``` int TestBody_got; namespace std { template struct integral_constant { static const int value = __v; }; template using enable_if_t = _Tp; template class initializer_list {}; template constexpr bool IsTypeOrDerived =

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-15 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Can we revert this change while you are investigating if this fix is not trivial? https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-15 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Great, I just finished a creduce run with renaming pass disabled, but yours is short. https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] Allow passing creduce options through creduce-clang-crash.py (PR #92141)

2024-05-14 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/92141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Allow passing creduce options through creduce-clang-crash.py (PR #92141)

2024-05-14 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/92141 >From 39d996deffc9d77c28f9f43c2f2ba4b114dd864f Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 14 May 2024 12:08:15 -0400 Subject: [PATCH 1/2] Allow passing creduce options through creduce-clang-crash.py -

[clang] Allow passing creduce options through creduce-clang-crash.py (PR #92141)

2024-05-14 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu created https://github.com/llvm/llvm-project/pull/92141 This change allows us to pass creduce options to creduce-clang-crash.py script. With this, `--n` is no longer needed to specify the number of cores, so removed the flag. The motivation is https://github.com/l

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-13 Thread Zequan Wu via cfe-commits
ZequanWu wrote: ``` $ cat a.cpp namespace std { template struct b { static const int c = a; }; template using e = d; template struct p { using g = f; }; template using i = p::g; template class initializer_list {}; template using j = __remove_pointer(d); template using k = j; template

[clang] [Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer (PR #87933)

2024-05-13 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Heads up. This causes clang to crash on some code. I'm running creduce to reduce the cpp source file. https://github.com/llvm/llvm-project/pull/87933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang][CoverageMapping] do not emit gap when either end is an `ImplicitValueInitExpr` (PR #89564)

2024-04-22 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu approved this pull request. https://github.com/llvm/llvm-project/pull/89564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CoverageMapping] do not emit gap when either end is an `ImplicitValueInitExpr` (PR #89564)

2024-04-22 Thread Zequan Wu via cfe-commits
ZequanWu wrote: There could be some other statements with invalid source locations (we have seen that before). I suggest validating both source locations inside `findGapAreaBetween` and returning `std::nullopt` if either of them is invalid. https://github.com/llvm/llvm-project/pull/89564 _

[clang] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-25 Thread Zequan Wu via cfe-commits
@@ -102,23 +104,24 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - void begin(std::string Name, llvm::function_ref Detail) { -Stack.emplace_back(ClockType::now(), TimePointType(), std::move(Name), - Detail()); + Time

[clang] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-25 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/83961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-25 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu approved this pull request. https://github.com/llvm/llvm-project/pull/83961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-13 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > > > > IIUC, the approach you choose here is to let `SemaPPCallbacks` control > > > > the "entered file stack" and allow it to remove element (which is file) > > > > from middle of the internal stack in `TimeTraceProfiler`, but this > > > > creates async event which is not des

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-12 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > > IIUC, the approach you choose here is to let `SemaPPCallbacks` control the > > "entered file stack" and allow it to remove element (which is file) from > > middle of the internal stack in `TimeTraceProfiler`, but this creates async > > event which is not designed for this p

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-12 Thread Zequan Wu via cfe-commits
@@ -102,23 +104,24 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - void begin(std::string Name, llvm::function_ref Detail) { -Stack.emplace_back(ClockType::now(), TimePointType(), std::move(Name), - Detail()); + Time

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-11 Thread Zequan Wu via cfe-commits
@@ -132,15 +135,18 @@ struct llvm::TimeTraceProfiler { // happens to be the ones that don't have any currently open entries above // itself. if (llvm::none_of(llvm::drop_begin(llvm::reverse(Stack)), - [&](const TimeTraceProfilerEntry &Val) { -

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-11 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu commented: IIUC, the approach you choose here is to let `SemaPPCallbacks` control the "entered file stack" and allow it to remove element (which is file) from middle of the internal stack in `TimeTraceProfiler`, but this creates async event which is not designed for

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-11 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/83961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Use timeTraceAsyncProfilerBegin for Source span (PR #83961)

2024-03-11 Thread Zequan Wu via cfe-commits
@@ -102,23 +104,24 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - void begin(std::string Name, llvm::function_ref Detail) { -Stack.emplace_back(ClockType::now(), TimePointType(), std::move(Name), - Detail()); + Time

[llvm] [clang] [clang-tools-extra] [compiler-rt] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
@@ -35,20 +36,32 @@ class InstrProfCorrelator { /// correlate. enum ProfCorrelatorKind { NONE, DEBUG_INFO, BINARY }; + struct WarningCounter { ZequanWu wrote: Since there is [debate](https://github.com/llvm/llvm-project/pull/75957#discussion_r1433009581

[llvm] [clang-tools-extra] [compiler-rt] [clang] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
@@ -42,6 +43,21 @@ template BuildIDRef getBuildID(const ELFFile &Obj) { return {}; } +BuildIDRef getBuildID(const COFFObjectFile *Obj) { ZequanWu wrote: By that, we don't have any test for it. The test `compiler-rt/test/profile/Windows/instrprof-binary-c

[llvm] [compiler-rt] [clang] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,33 @@ +// Test llvm-profdata merging with multiple correlation files mixing different correlation modes. + +// RUN: %clang_pgogen -o %t.normal -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-fo

[clang] [compiler-rt] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,41 @@ +// REQUIRES: target={{.*windows-msvc.*}} ZequanWu wrote: Yes, for mingw, `-dll` doesn't work. It uses `-shared` https://github.com/llvm/llvm-project/pull/75957 ___ cfe-commits mailing list cfe-commits

[compiler-rt] [clang] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[clang] [llvm] [compiler-rt] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/75957 >From d72f0e1ad7759bad81767418604d27f11d74d6de Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 19 Dec 2023 12:32:15 -0500 Subject: [PATCH 1/5] [Profile] Allow profile merging with multiple correlate files.

[llvm] [libcxx] [compiler-rt] [clang] [mlir] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-11 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Reverted at e7f794875169811f3801fad6d40bb9fe833e1a69. Will file an issue to track it once reducing is done. https://github.com/llvm/llvm-project/pull/77210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[libcxx] [clang] [llvm] [compiler-rt] [mlir] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-11 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Heads up! This causes clang crash: cmd: ``` clang++ "-cc1" "-triple" "x86_64-apple-macosx10.15.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-femit-dwarf-unwind=no-compact-unwind" "-disable-f

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-10 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > @ZequanWu would either of these work for you? > > ```c++ > DCHECK_OK(foo); // > expected-error@components/reporting/util/status_macros.h:* > {{{CHECK,DCHECK,ASSERT,EXPECT}_OK do not accept a type other than Status or > StatusOr.}}} > ``` > > or > > ```c++ > DCHECK_OK(foo

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-10 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Hi, this breaks our build. I don't know how to update the expectation to match Current expectation: DCHECK_OK(foo); // expected-error@components/reporting/util/status_macros.h:* {{{CHECK,DCHECK,ASSERT,EXPECT}_OK do not accept a type other than Status or StatusOr.}} https

[clang-tools-extra] [llvm] [compiler-rt] [clang] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-10 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Ping. https://github.com/llvm/llvm-project/pull/75957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [clang] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-02 Thread Zequan Wu via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[compiler-rt] [clang] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-02 Thread Zequan Wu via cfe-commits
@@ -481,3 +509,49 @@ Error BinaryInstrProfCorrelator::correlateProfileNameImpl() { this->Names.append(this->Ctx->NameStart, this->Ctx->NameSize); return Error::success(); } + +llvm::Expected> InstrProfCorrelators::get( +ArrayRef> +CorrelateInputs, +uint32_

[llvm] [compiler-rt] [clang] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
@@ -481,3 +509,49 @@ Error BinaryInstrProfCorrelator::correlateProfileNameImpl() { this->Names.append(this->Ctx->NameStart, this->Ctx->NameSize); return Error::success(); } + +llvm::Expected> InstrProfCorrelators::get( +ArrayRef> +CorrelateInputs, +uint32_

[clang] [llvm] [compiler-rt] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[compiler-rt] [llvm] [clang] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
@@ -25,6 +25,25 @@ // RUN: diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata) +// Test debug info correlate with build id. ZequanWu wrote: The added test in `Linux/instr

[compiler-rt] [clang] [clang-tools-extra] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available ZequanWu wrote: The added test in `Linux/instrprof-debug-info-correlate.c` requires build id. Does darwin linker ld64 or ld64.lld have the option to emit build id into binary? I don't find such flag. https://github.

[compiler-rt] [llvm] [clang] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available ZequanWu wrote: Added by mistake. Removed. https://github.com/llvm/llvm-project/pull/75957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[llvm] [compiler-rt] [clang] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/75957 >From d72f0e1ad7759bad81767418604d27f11d74d6de Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 19 Dec 2023 12:32:15 -0500 Subject: [PATCH 1/4] [Profile] Allow profile merging with multiple correlate files.

[clang] [llvm] [compiler-rt] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/75957 >From d72f0e1ad7759bad81767418604d27f11d74d6de Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 19 Dec 2023 12:32:15 -0500 Subject: [PATCH 1/3] [Profile] Allow profile merging with multiple correlate files.

[compiler-rt] [clang] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2023-12-15 Thread Zequan Wu via cfe-commits
@@ -234,8 +246,20 @@ struct MapRegionCounters : public RecursiveASTVisitor { if (Hash.getHashVersion() == PGO_HASH_V1) return Base::TraverseIfStmt(If); +// When single byte coverage mode is enabled, add a counter to then and +// else. +for (Stmt *CS : If

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2023-12-15 Thread Zequan Wu via cfe-commits
@@ -569,16 +577,26 @@ struct CounterCoverageMappingBuilder /// Return a counter for the subtraction of \c RHS from \c LHS Counter subtractCounters(Counter LHS, Counter RHS, bool Simplify = true) { +if (llvm::EnableSingleByteCoverage) + assert( + 0 && +

[clang-tools-extra] [compiler-rt] [clang] [llvm] [flang] [lldb] [mlir] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-14 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > Well, seems like someone broke ToT w/ a compiler error. I'll let you know if > the forward fix fails to address the issue. The latest build passed: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8761696377585255057/overview. https://github.

[llvm] [mlir] [lldb] [clang-tools-extra] [compiler-rt] [clang] [flang] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-14 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > Seems like a mismatch on the diff, so maybe the check is too stringent. > > If this will take a while to fix, would you mind reverting until it can be > addressed? It passed for me locally on x64. Maybe I should use `diff <(llvm-profdata show --all-functions --counts %t.norm

[clang] [llvm] [mlir] [lldb] [clang-tools-extra] [compiler-rt] [flang] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-14 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu closed https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [flang] [llvm] [lldb] [mlir] [clang-tools-extra] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-12 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -mllvm -profile-correlate=binary -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s --check-prefix=BIN-CORRELATE

[llvm] [compiler-rt] [lldb] [clang] [mlir] [flang] [clang-tools-extra] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-12 Thread Zequan Wu via cfe-commits
@@ -1829,6 +1833,22 @@ void CoverageMappingModuleGen::emit() { llvm::GlobalValue::InternalLinkage, NamesArrVal, llvm::getCoverageUnusedNamesVarName()); } + const StringRef VarName(INSTR_PROF_QUOTE(INSTR_PROF_RAW_VERSI

[clang] [llvm] [lldb] [mlir] [compiler-rt] [clang-tools-extra] [flang] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-12 Thread Zequan Wu via cfe-commits
@@ -1829,6 +1833,22 @@ void CoverageMappingModuleGen::emit() { llvm::GlobalValue::InternalLinkage, NamesArrVal, llvm::getCoverageUnusedNamesVarName()); } + const StringRef VarName(INSTR_PROF_QUOTE(INSTR_PROF_RAW_VERSI

[clang] [flang] [llvm] [clang-tools-extra] [mlir] [lldb] [compiler-rt] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-05 Thread Zequan Wu via cfe-commits
@@ -702,6 +708,8 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure, #define INSTR_PROF_COVMAP_COMMON __llvm_covmap #define INSTR_PROF_COVFUN_COMMON __llvm_covfun #define INSTR_PROF_ORDERFILE_COMMON __llvm_orderfile ZequanWu wrote: Done. https://gi

[mlir] [llvm] [lldb] [flang] [clang] [compiler-rt] [clang-tools-extra] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-12-05 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > Can you break up all the changes to tests that replace > `-debug-info-correlate` with `--profile-correlate=debug-info` into a separate > PR to reduce the size of this PR? Done. https://github.com/llvm/llvm-project/pull/69493 ___ cf

[llvm] [mlir] [clang-tools-extra] [clang] [lldb] [compiler-rt] [flang] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-11-28 Thread Zequan Wu via cfe-commits
ZequanWu wrote: Ping. https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [lldb] [compiler-rt] [flang] [clang] [mlir] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-11-16 Thread Zequan Wu via cfe-commits
ZequanWu wrote: > Some further discussion/pre-work needed before proceeding with this PR. These two discussions are addressed and this is ready to be reviewed. 1. Support for merging with multiple correlation files will be done in a separate change. 2. Removed the `VARIANT_MASK_BIN_CORRELATE`

[clang] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)

2023-11-16 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu approved this pull request. https://github.com/llvm/llvm-project/pull/71564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)

2023-11-16 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cl --target=x86_64-windows-msvc /c /Z7 -o %t.obj -- %s ZequanWu wrote: I think you are missing `-gcodeview` in the command line to emit the debug info. The change should reflect on a metadata. `llvm/test/DebugInfo/COFF` is the p

[llvm] [compiler-rt] [clang-tools-extra] [lldb] [clang] [flang] [mlir] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [compiler-rt] [mlir] [llvm] [clang] [clang-tools-extra] [lldb] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [mlir] [clang] [lldb] [compiler-rt] [llvm] [flang] [Profile] Add binary profile correlation for code coverage. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu edited https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [mlir] [clang] [lldb] [compiler-rt] [llvm] [flang] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -0,0 +1,46 @@ +// REQUIRES: linux || windows +// Default +// RUN: %clang -o %t.normal -fprofile-instr-generate -fcoverage-mapping -fuse-ld=lld %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp +// RUN: env LLVM_PROFILE_FILE=%t.

[compiler-rt] [flang] [llvm] [lldb] [clang-tools-extra] [clang] [mlir] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -195,8 +195,14 @@ OPTIONS .. option:: --debug-info= Specify the executable or ``.dSYM`` that contains debug info for the raw profile. - When ``-debug-info-correlate`` was used for instrumentation, use this option - to correlate the raw profile. + When ``-profile-correlate

[lldb] [clang-tools-extra] [clang] [mlir] [flang] [llvm] [compiler-rt] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -1341,20 +1344,26 @@ void InstrProfiling::createDataVariable(InstrProfCntrInstBase *Inc, } auto *Data = new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName); - // Reference the counter variable with a label difference (link-time - // constant). -

[compiler-rt] [flang] [mlir] [llvm] [clang] [clang-tools-extra] [lldb] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -1331,6 +1336,18 @@ static int merge_main(int argc, const char *argv[]) { "(default: 1)")); cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n"); + if (!DebugInfoFilename.empty() && !BinaryFilename.empty()) { +exitWithError("Expect

[flang] [compiler-rt] [lldb] [llvm] [mlir] [clang] [clang-tools-extra] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -1331,6 +1336,18 @@ static int merge_main(int argc, const char *argv[]) { "(default: 1)")); cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n"); + if (!DebugInfoFilename.empty() && !BinaryFilename.empty()) { +exitWithError("Expect

[clang] [flang] [llvm] [clang-tools-extra] [lldb] [compiler-rt] [mlir] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
https://github.com/ZequanWu commented: > "binary" is ambiguous. I wonder whether object file correlation is better. > llvm-symbolizer has an option --obj=xxx. llvm-symbolizer's `--obj` could take an pre-linking object file. But here we need to take post-linked binary for merging. https://gith

[lldb] [mlir] [llvm] [clang] [compiler-rt] [flang] [clang-tools-extra] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

2023-11-15 Thread Zequan Wu via cfe-commits
@@ -46,14 +73,38 @@ const char *InstrProfCorrelator::NumCountersAttributeName = "Num Counters"; llvm::Expected> InstrProfCorrelator::Context::get(std::unique_ptr Buffer, - const object::ObjectFile &Obj) { + con

  1   2   3   >