[clang] [llvm] [clang-tools-extra] Dont alter cold function alignment unless using Os (PR #72387)

2023-11-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: This patch appears to do two things: - Add a "default align" attribute, which instructions the backend to use some unspecified "default" alignment for the function in question. - Tells the frontend to apply this attribute specifically to "cold" functions. This is basically

[compiler-rt] [clang] [llvm] [AArch64][SME] Add support for sme-fa64 (PR #70809)

2023-11-15 Thread Pavel Iliin via cfe-commits
@@ -1363,6 +1367,8 @@ static void __init_cpu_features_constructor(unsigned long hwcap, setCPUFeature(FEAT_SME_I64); if (hwcap2 & HWCAP2_SME_F64F64) setCPUFeature(FEAT_SME_F64); + if (hwcap2 & HWCAP2_SME_FA64) +setCPUFeature(FEAT_SME_FA64); ilinp

[clang] [CUDA][HIP] Fix deduction guide (PR #69366)

2023-11-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > @ldionne - Can you take a look if that would have unintended consequences > > for libc++? > > Honestly, I don't know. I don't know CUDA nearly well enough to understand > all the implications here. All I know is that this seems to be a pretty > significant "fork" of C++ in

[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,163 @@ +//===--- APINotesManager.h - Manage API Notes Files -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Saleem Abdulrasool via cfe-commits
@@ -0,0 +1,469 @@ +//===--- APINotesManager.cpp - Manage API Notes Files -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [flang] [llvm] [clang-tools-extra] [compiler-rt] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [Clang] Correct handling of negative and out-of-bounds indices (PR #71877)

2023-11-15 Thread Bill Wendling via cfe-commits
bwendling wrote: @kees interesting difference between `0` and `1` in `__bdos()`. You probably know about it, but I was surprised: https://godbolt.org/z/KTeqanjKf https://github.com/llvm/llvm-project/pull/71877 ___ cfe-commits mailing list cfe-commits@

[clang] [llvm] Add RunTimeLang to Class and Enumeration DIBuilder functions (PR #72011)

2023-11-15 Thread Augusto Noronha via cfe-commits
https://github.com/augusto2112 updated https://github.com/llvm/llvm-project/pull/72011 >From 8cebb68070de258e6f581e83c3b0541087f53570 Mon Sep 17 00:00:00 2001 From: Augusto Noronha Date: Mon, 13 Nov 2023 09:48:00 -0800 Subject: [PATCH] [DebugInfo][CGDebugInfo] Add RunTimeLang to more DIBuilder

[clang] d0ae239 - Add RunTimeLang to Class and Enumeration DIBuilder functions (#72011)

2023-11-15 Thread via cfe-commits
Author: Augusto Noronha Date: 2023-11-15T12:46:06-08:00 New Revision: d0ae2391897033c50225a20fd3024816dffd80b6 URL: https://github.com/llvm/llvm-project/commit/d0ae2391897033c50225a20fd3024816dffd80b6 DIFF: https://github.com/llvm/llvm-project/commit/d0ae2391897033c50225a20fd3024816dffd80b6.dif

[clang] [llvm] Add RunTimeLang to Class and Enumeration DIBuilder functions (PR #72011)

2023-11-15 Thread Augusto Noronha via cfe-commits
https://github.com/augusto2112 closed https://github.com/llvm/llvm-project/pull/72011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Cleanup and sort hlsl_intrinsics.h (PR #72414)

2023-11-15 Thread Chris B via cfe-commits
@@ -11,557 +11,614 @@ namespace hlsl { -__attribute__((availability(shadermodel, introduced = 6.0))) -__attribute__((clang_builtin_alias(__builtin_hlsl_wave_active_count_bits))) uint -WaveActiveCountBits(bool bBit); +// Note: Functions in this file are sorted alphabetically,

[clang-tools-extra] [compiler-rt] [flang] [llvm] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

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

[clang-tools-extra] [compiler-rt] [flang] [llvm] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

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

[clang] [Clang] Correct handling of negative and out-of-bounds indices (PR #71877)

2023-11-15 Thread Kees Cook via cfe-commits
kees wrote: Yeah, this is the "compiler doesn't know if pointer points into an array of structs or not" that has driven me crazy for years. But we can now reliably disambiguate this for structs that end with a flexible array member (or future pointers marked with `__single`). It's been a long

[clang] [flang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/66702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: [nit] Dynamic linker will only be used with shared objects, but this file also tests `static`. So the name is a bit confusing. But I don't have any great suggestion myself. Perhaps update the comment to clarify that this test is specifical

[clang] [flang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. Thanks for seeing this through, that's much appreciated! https://github.com/llvm/llvm-project/pull/66702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-15 Thread Piotr Zegar via cfe-commits
@@ -208,6 +208,11 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`bugprone-assert-side-effect + ` check to report usage of + non-const `<<` and `>>` operators in assertions and fixed some false-positives PiotrZSL

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, rebase code before merging https://github.com/llvm/llvm-project/pull/71974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Use AllocaRegion in MallocChecker (PR #72402)

2023-11-15 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: Hmm, it really worries me that `MallocChecker` is setting a return value outside of `evalCall()`. This can easily lead to conflicts if multiple checkers try to do this: `evalCall()` is protected from conflicts (the engine asserts that at most one checker evaluates each call) but

[clang] [analyzer] Use AllocaRegion in MallocChecker (PR #72402)

2023-11-15 Thread Artem Dergachev via cfe-commits
@@ -266,13 +266,18 @@ void CheckUseZeroAllocated1(void) { } char CheckUseZeroAllocated2(void) { + // FIXME: The return value of `alloca()` is modeled with `AllocaRegion` + // instead of `SymbolicRegion`, so the current implementation of + // `MallocChecker::checkUseZeroAllo

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang] [clang-tools-extra] [MS-ABI] skip generate comdat for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. https://github.com/llvm/llvm-project/pull/71748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add support for Cortex-A520, Cortex-A720 and Cortex-X4 CPUs (PR #72395)

2023-11-15 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray updated https://github.com/llvm/llvm-project/pull/72395 >From 07b24207d100ac7d5deac76543c01710b8cab79e Mon Sep 17 00:00:00 2001 From: Jonathan Thackray Date: Fri, 10 Nov 2023 15:37:08 + Subject: [PATCH] [AArch64] Add support for Cortex-A520, Cortex-A720 and Cor

[llvm] [clang] [AArch64] Add support for Cortex-A520, Cortex-A720 and Cortex-X4 CPUs (PR #72395)

2023-11-15 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff c70f6fc4f4c33656b2048e37c287d5c811f413b2 07b24207d100ac7d5deac76543c01710b8cab79e --

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-15 Thread via cfe-commits
https://github.com/schenker updated https://github.com/llvm/llvm-project/pull/71974 >From dabfdee1a982000605e4b33930ba433c63d1684f Mon Sep 17 00:00:00 2001 From: Thomas Schenker Date: Fri, 10 Nov 2023 18:58:26 +0100 Subject: [PATCH 1/5] [clang-tidy] bugprone-assert-side-effect non-const operat

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 01/25] [clang] Add support for new loop attribute [[clang::code

[clang] [flang] [clang-tools-extra] [compiler-rt] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-15 Thread via cfe-commits
https://github.com/schenker updated https://github.com/llvm/llvm-project/pull/71974 >From 1f6e70ef97ba1bf90c829c212c6c1e09be4961f4 Mon Sep 17 00:00:00 2001 From: Thomas Schenker Date: Fri, 10 Nov 2023 18:58:26 +0100 Subject: [PATCH 1/5] [clang-tidy] bugprone-assert-side-effect non-const operat

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [flang] [clang-tools-extra] [compiler-rt] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang] [LinkerWrapper] Support device binaries in multiple link jobs (PR #72442)

2023-11-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/72442 Summary: Currently the linker wrapper strictly assigns a single input binary to a single link job based off of its input architecture. This is not sufficient to implement the AMDGPU target ID correctly as this cou

[llvm] [clang] [LinkerWrapper] Support device binaries in multiple link jobs (PR #72442)

2023-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-binary-utilities Author: Joseph Huber (jhuber6) Changes Summary: Currently the linker wrapper strictly assigns a single input binary to a single link job based off of its input architecture. This is not sufficient to implement the AMDGPU target ID c

[flang] [clang-tools-extra] [compiler-rt] [llvm] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 01/26] [clang] Add support for new loop attribute [[clang::code

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread John McCall via cfe-commits
rjmccall wrote: I agree with the Sema/AST-level LGTM (but also don't feel comfortable approving the driver changes) https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread via cfe-commits
dyung wrote: Hi @Michael137, we are seeing a failure in one of our internal tests that I bisected back to this change. Consider the following code: ```C++ struct X { static const int constant = 1; int x; X() { x = constant; } }; const int X::constant; int main() { X x; x.x

[clang-tools-extra] [clang] [llvm] [MS-ABI] skip generate comdat for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread via cfe-commits
@@ -125,9 +125,9 @@ // MS-TYPEMETADATA: comdat($"??_7B@@6B0@@"), !type [[B8:![0-9]+]] // MS-TYPEMETADATA: comdat($"??_7B@@6BA@@@"), !type [[A8]] // MS-TYPEMETADATA: comdat($"??_7C@@6B@"), !type [[A8]] -// MS-TYPEMETADATA: comdat($"??_7D@?A0x{{[^@]*}}@@6BB@@@"), !type [[B8]], !

[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread Michael Buch via cfe-commits
Michael137 wrote: > Hi @Michael137, we are seeing a failure in one of our internal tests that I > bisected back to this change. Consider the following code: > > ```c++ > struct X > { > static const int constant = 1; > int x; > > X() { x = constant; } > }; > const int X::constant; >

[clang] 250d9c8 - [clang][SME][NFC] Add -fclang-abi-compat=latest to tests.

2023-11-15 Thread Amara Emerson via cfe-commits
Author: Amara Emerson Date: 2023-11-15T14:12:52-08:00 New Revision: 250d9c86c201799755611c425ce6e02fb5867716 URL: https://github.com/llvm/llvm-project/commit/250d9c86c201799755611c425ce6e02fb5867716 DIFF: https://github.com/llvm/llvm-project/commit/250d9c86c201799755611c425ce6e02fb5867716.diff

[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread via cfe-commits
dyung wrote: > > Hi @Michael137, we are seeing a failure in one of our internal tests that I > > bisected back to this change. Consider the following code: > > ```c++ > > struct X > > { > > static const int constant = 1; > > int x; > > > > X() { x = constant; } > > }; > > const int

[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread Paul T Robinson via cfe-commits
pogo59 wrote: The member is const with an initializer in-class. How is the constant value not available for the definition? https://github.com/llvm/llvm-project/pull/71780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [lldb] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread Michael Buch via cfe-commits
Michael137 wrote: > The member is const with an initializer in-class. How is the constant value > not available for the definition? Right, it is available, we just don't attach it if we have a location for it. Don't see why we couldn't put it on the definition if we have the constant on hand

[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. Some minor comments left to address about comments, but the rest LGTM. https://github.com/llvm/llvm-project/pull/72389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread John McCall via cfe-commits
rjmccall wrote: First off, the change here actually applies to all over-aligned empty structs, not just to those with aligned bit-fields. Maybe we can say that aligned zero-width bit-fields are ill-formed, but I don't think we can say that all aligned empty classes are ill-formed, among other

[clang] b04664b - [clang-format] Handle constrained auto in QualifierAlignment (#72251)

2023-11-15 Thread via cfe-commits
Author: Owen Pan Date: 2023-11-15T14:28:37-08:00 New Revision: b04664be6f484551ba34e5e34c511e77d5af709a URL: https://github.com/llvm/llvm-project/commit/b04664be6f484551ba34e5e34c511e77d5af709a DIFF: https://github.com/llvm/llvm-project/commit/b04664be6f484551ba34e5e34c511e77d5af709a.diff LOG:

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-15 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] eaff083 - [clang-format] Fix more bugs in isStartOfName() (#72336)

2023-11-15 Thread via cfe-commits
Author: Owen Pan Date: 2023-11-15T14:31:30-08:00 New Revision: eaff083035c86e32bd220fef5a2fab47117b70c1 URL: https://github.com/llvm/llvm-project/commit/eaff083035c86e32bd220fef5a2fab47117b70c1 DIFF: https://github.com/llvm/llvm-project/commit/eaff083035c86e32bd220fef5a2fab47117b70c1.diff LOG:

[clang] [clang-format] Fix more bugs in isStartOfName() (PR #72336)

2023-11-15 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread John McCall via cfe-commits
rjmccall wrote: Oh, the [Apple AArch64 calling convention](https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Pass-arguments-to-functions-correctly) diverges from AAPCS and ignores empty classes as parameters. We appear to consider this an empty class regar

[clang-tools-extra] [clang] [llvm] [MS-ABI] skip generate comdat for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread via cfe-commits
https://github.com/jyu2-git updated https://github.com/llvm/llvm-project/pull/71748 >From 3313aca0622da3882a9e5bf304b89f28fecce7fe Mon Sep 17 00:00:00 2001 From: Jennifer Yu Date: Mon, 6 Nov 2023 20:51:39 -0800 Subject: [PATCH 1/4] [SEH] Fix assertin when return scalar value from __try block.

[flang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [clang] [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 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

[compiler-rt] [clang] [llvm] [clang-tools-extra] [lldb] [mlir] [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,11 @@ +; RUN: opt < %s -passes=instrprof -profile-correlate=binary -S | FileCheck %s ZequanWu wrote: Moved the test to `coverage.ll` https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing li

[clang-tools-extra] [compiler-rt] [lldb] [llvm] [clang] [flang] [mlir] [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,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] [clang] [flang] [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
@@ -0,0 +1,46 @@ +// REQUIRES: linux || windows ZequanWu wrote: I think lld is not require, removed `-fuse-ld=lld`. https://github.com/llvm/llvm-project/pull/69493 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[flang] [lldb] [compiler-rt] [llvm] [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
@@ -1829,6 +1833,22 @@ void CoverageMappingModuleGen::emit() { llvm::GlobalValue::InternalLinkage, NamesArrVal, llvm::getCoverageUnusedNamesVarName()); } + const StringRef VarName(INSTR_PROF_QUOTE(INSTR_PROF_RAW_VERSI

[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

[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

[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

[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

[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] [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

[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.

[PATCH] D158824: [RISCV][MC] MC layer support for xcvmem and xcvelw extensions

2023-11-15 Thread Craig Topper via Phabricator via cfe-commits
craig.topper accepted this revision. craig.topper added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158824/new/ https://reviews.llvm.org/D158824 ___

[clang] [lldb] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread via cfe-commits
dyung wrote: > > The member is const with an initializer in-class. How is the constant value > > not available for the definition? > > Right, it is available, we just don't attach it if we have a location for it. > Don't see why we couldn't put it on the definition if we have the constant on

[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

[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread Paul T Robinson via cfe-commits
pogo59 wrote: I think it is a valuable bit of information for the debugger, to know the constant value without having to read it from memory. I think we should emit both the location and the value. https://github.com/llvm/llvm-project/pull/71780 ___

[clang] [X86][AVX10] Fix a bug when using -march with no-evex512 attribute (PR #72126)

2023-11-15 Thread via cfe-commits
ronlieb wrote: thanks for the fix, working great now. https://github.com/llvm/llvm-project/pull/72126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [compiler-rt] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -12,27 +12,78 @@ #ifndef LLVM_ANALYSIS_INDIRECTCALLVISITOR_H #define LLVM_ANALYSIS_INDIRECTCALLVISITOR_H +#include "llvm/ADT/SetVector.h" #include "llvm/IR/InstVisitor.h" #include namespace llvm { -// Visitor class that finds all indirect call. +// Visitor class that

[clang-tools-extra] [clang] [llvm] [compiler-rt] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -490,6 +591,23 @@ Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName) { return Error::success(); } +uint64_t InstrProfSymtab::getVTableHashFromAddress(uint64_t Address) { + finalizeSymtab(); + auto It = lower_bound( + VTableAddrRangeToMD5Map

[llvm] [clang-tools-extra] [clang] [compiler-rt] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -1441,6 +1531,9 @@ void OverlapStats::dump(raw_fd_ostream &OS) const { case IPVK_MemOPSize: strncpy(ProfileKindName, "MemOP", 19); break; +case IPVK_VTableTarget: + strncpy(ProfileKindName, "VTable", 6); minglotus-6 wrote: thanks fo

[compiler-rt] [llvm] [clang] [clang-tools-extra] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 edited https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [compiler-rt] [clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 commented: thanks for the reviews and discussions! This PR currently merged upstream main at a commit on Nov 9th. I started to have local changes after that, so refrained from another merge. Will do that separately. https://github.com/llvm/llvm-project/pull/6682

[compiler-rt] [clang-tools-extra] [clang] [llvm] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -123,19 +137,29 @@ static int needsCounterPadding(void) { COMPILER_RT_VISIBILITY void __llvm_profile_get_padding_sizes_for_counters( uint64_t DataSize, uint64_t CountersSize, uint64_t NumBitmapBytes, -uint64_t NamesSize, uint64_t *PaddingBytesBeforeCounters, -uin

[compiler-rt] [llvm] [clang-tools-extra] [clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -275,18 +282,28 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin, const uint64_t NumBitmapBytes = __llvm_profile_get_num_bitmap_bytes(BitmapBegin, BitmapEnd); const uint64_t NamesSize = __llvm_profile_get_name_size(NamesBegin, Na

[compiler-rt] [clang] [clang-tools-extra] [llvm] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -489,30 +520,66 @@ class InstrProfSymtab { /// \p IterRange. This interface is used by IndexedProfReader. template Error create(const NameIterRange &IterRange); - /// Update the symtab by adding \p FuncName to the table. This interface - /// is used by the raw and t

[clang-tools-extra] [llvm] [compiler-rt] [clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -453,11 +471,94 @@ Error InstrProfSymtab::create(Module &M, bool InLTO) { if (Error E = addFuncWithName(F, getPGOFuncName(F, InLTO))) return E; } + + SmallVector Types; + for (GlobalVariable &G : M.globals()) { +if (!G.hasName()) + continue; +Types

[llvm] [clang] [clang-tools-extra] [compiler-rt] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -1070,8 +1084,138 @@ void InstrProfiling::maybeSetComdat(GlobalVariable *GV, Function *Fn, GV->setLinkage(GlobalValue::InternalLinkage); } -GlobalVariable *InstrProfiling::setupProfileSection(InstrProfInstBase *Inc, -

[llvm] [compiler-rt] [clang] [clang-tools-extra] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #668

2023-11-15 Thread Mingming Liu via cfe-commits
@@ -1070,8 +1084,138 @@ void InstrProfiling::maybeSetComdat(GlobalVariable *GV, Function *Fn, GV->setLinkage(GlobalValue::InternalLinkage); } -GlobalVariable *InstrProfiling::setupProfileSection(InstrProfInstBase *Inc, -

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. Marking as changes requested so that this doesn't get committed. https://github.com/llvm/llvm-project/pull/72197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [lldb] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread Michael Buch via cfe-commits
Michael137 wrote: > So I guess what you are saying in this case is that it is expected and the > value is at the location indicated by the DW_AT_location value? As long as > the value is still available I suppose that is fine then and the test just > needs updating. Yup that's exactly right.

[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] d7ce580 - Add -fclang-abi-compat=latest to aarch64-sve-vector-init.cpp

2023-11-15 Thread Amara Emerson via cfe-commits
Author: Amara Emerson Date: 2023-11-15T15:22:12-08:00 New Revision: d7ce58048a586157e709e2dca5f33dd4f41b087d URL: https://github.com/llvm/llvm-project/commit/d7ce58048a586157e709e2dca5f33dd4f41b087d DIFF: https://github.com/llvm/llvm-project/commit/d7ce58048a586157e709e2dca5f33dd4f41b087d.diff

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-15 Thread Louis Dionne via cfe-commits
@@ -172,3 +172,32 @@ // RUN: --check-prefix=CHECK-LIBCXX-STDLIB-UNSPECIFIED %s // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-cc1" // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1" + +// --

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-15 Thread Louis Dionne via cfe-commits
@@ -172,3 +172,32 @@ // RUN: --check-prefix=CHECK-LIBCXX-STDLIB-UNSPECIFIED %s // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-cc1" // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1" + +// --

[clang] [clang codegen][regression] Add dso_local/hidden/etc. markings to VTT definitions and declarations (PR #72452)

2023-11-15 Thread via cfe-commits
https://github.com/bd1976bris created https://github.com/llvm/llvm-project/pull/72452 https://reviews.llvm.org/D128482 regressed certain cases of VTT emission which are no longer hidden with -fvisibility=hidden. Fix this regression by marking both declarations and definitions. Fixes [clang co

[clang] d5af076 - [clang][analyzer] Support `fputc` in StreamChecker (#71518)

2023-11-15 Thread via cfe-commits
Author: Ben Shi Date: 2023-11-16T07:36:57+08:00 New Revision: d5af076a99b625b4caf0b72b97ee6c88af6f4ba4 URL: https://github.com/llvm/llvm-project/commit/d5af076a99b625b4caf0b72b97ee6c88af6f4ba4 DIFF: https://github.com/llvm/llvm-project/commit/d5af076a99b625b4caf0b72b97ee6c88af6f4ba4.diff LOG:

[clang] [clang][analyzer] Support `fputc` in StreamChecker (PR #71518)

2023-11-15 Thread Ben Shi via cfe-commits
https://github.com/benshi001 closed https://github.com/llvm/llvm-project/pull/71518 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang codegen][regression] Add dso_local/hidden/etc. markings to VTT definitions and declarations (PR #72452)

2023-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: bd1976bris (bd1976bris) Changes https://reviews.llvm.org/D128482 regressed certain cases of VTT emission which are no longer hidden with -fvisibility=hidden. Fix this regression by marking both declarations and definitions. Fixes [clang

[clang] [clang codegen][regression] Add dso_local/hidden/etc. markings to VTT definitions and declarations (PR #72452)

2023-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: bd1976bris (bd1976bris) Changes https://reviews.llvm.org/D128482 regressed certain cases of VTT emission which are no longer hidden with -fvisibility=hidden. Fix this regression by marking both declarations and definitions. Fixes

[clang] 917a550 - [clang][Analyzer][NFC] Use condition type for comparison in several checkers (#72358)

2023-11-15 Thread via cfe-commits
Author: Ben Shi Date: 2023-11-16T07:37:33+08:00 New Revision: 917a550f4d7aaa79b04ed8998a45695a29f0f748 URL: https://github.com/llvm/llvm-project/commit/917a550f4d7aaa79b04ed8998a45695a29f0f748 DIFF: https://github.com/llvm/llvm-project/commit/917a550f4d7aaa79b04ed8998a45695a29f0f748.diff LOG:

[clang] [clang][Analyzer][NFC] Use condition type for comparison in several checkers (PR #72358)

2023-11-15 Thread Ben Shi via cfe-commits
https://github.com/benshi001 closed https://github.com/llvm/llvm-project/pull/72358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang codegen][regression] Add dso_local/hidden/etc. markings to VTT definitions and declarations (PR #72452)

2023-11-15 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/72452 >From f6e400224b3a90b4ec47bce2212a8e760b0fe9d8 Mon Sep 17 00:00:00 2001 From: Ben Dunbobbin Date: Wed, 15 Nov 2023 23:09:41 + Subject: [PATCH] [clang codegen] Add dso_local/hidden/etc. markings to VTT def

[clang] [clang] Make `-fvisibility={}` and `-ftype-visibility={}` benign options. (PR #71985)

2023-11-15 Thread Juergen Ributzka via cfe-commits
https://github.com/ributzka updated https://github.com/llvm/llvm-project/pull/71985 >From a6a9ebe0f8077889b6cb4bafd75c9eb66a823bc4 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Fri, 10 Nov 2023 12:39:16 -0800 Subject: [PATCH 1/2] [clang] Make `-fvisibility={}` and `-ftype-visibility={}`

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits
ldionne wrote: This seems reasonable. I read the discussion about the size of the member but I think this is unlikely to change much -- plus I think the compiler should be able to diagnose in case the string becomes smaller and we'd be copying from a past-the-end location into the data structu

[libunwind] b7a249d - [libunwind] Remove unnecessary strcpy dependency (#72043)

2023-11-15 Thread via cfe-commits
Author: Michael Kenzel Date: 2023-11-15T18:41:53-05:00 New Revision: b7a249d26fe61432050df470d23bdea417fda574 URL: https://github.com/llvm/llvm-project/commit/b7a249d26fe61432050df470d23bdea417fda574 DIFF: https://github.com/llvm/llvm-project/commit/b7a249d26fe61432050df470d23bdea417fda574.diff

[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)

2023-11-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [clang] Ensure fixed point conversions work in C++ (PR #68344)

2023-11-15 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/68344 >From 1eb1638a12c619febf1fe9830f34e51a56d4c20e Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 5 Oct 2023 19:19:47 + Subject: [PATCH] [clang] Ensure fixed point conversions work in C++ --- clang/inc

[clang-tools-extra] [clang-tidy] Add new performance-use-starts-ends-with check (PR #72385)

2023-11-15 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/72385 >From 96e00378116ca5fbfad6edb220e86326dc4f9897 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 15 Nov 2023 01:13:10 -0800 Subject: [PATCH] [clang-tidy] Add new performance-use-starts-ends-with check

<    1   2   3   4   5   6   >