[clang] [Index] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124389)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124388)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124391)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-18 Thread Nikita Popov via cfe-commits
@@ -8,14 +8,14 @@ typedef float v4sf __attribute__ ((__vector_size__ (16))); typedef double v4df __attribute__ ((__vector_size__ (32))); typedef int v4i32 __attribute__ ((__vector_size__ (16))); -// O32-LABEL: define{{.*}} void @test_v4sf(ptr dead_on_unwind noalias nocapture

[clang] a4d9a8d - [Clang] Don't match irrelevant attributes in mips return tests (NFC)

2025-01-20 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-01-20T12:41:02+01:00 New Revision: a4d9a8de0820f3ccc2eb35870cac199e8dacd9e6 URL: https://github.com/llvm/llvm-project/commit/a4d9a8de0820f3ccc2eb35870cac199e8dacd9e6 DIFF: https://github.com/llvm/llvm-project/commit/a4d9a8de0820f3ccc2eb35870cac199e8dacd9e6.diff

[clang] a79ae86 - [Clang] Regenerate test checks (NFC)

2025-01-20 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-01-20T12:46:37+01:00 New Revision: a79ae862ab2999cad89879743335423b985ae3fd URL: https://github.com/llvm/llvm-project/commit/a79ae862ab2999cad89879743335423b985ae3fd DIFF: https://github.com/llvm/llvm-project/commit/a79ae862ab2999cad89879743335423b985ae3fd.diff

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-20 Thread Nikita Popov via cfe-commits
@@ -8,14 +8,14 @@ typedef float v4sf __attribute__ ((__vector_size__ (16))); typedef double v4df __attribute__ ((__vector_size__ (32))); typedef int v4i32 __attribute__ ((__vector_size__ (16))); -// O32-LABEL: define{{.*}} void @test_v4sf(ptr dead_on_unwind noalias nocapture

[clang] [ByteCode] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123445)

2025-01-18 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123444)

2025-01-18 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124447)

2025-01-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124446)

2025-01-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #124448)

2025-01-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124502)

2025-01-27 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124502 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-27 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/122486 >From 925f74cad21eb6c46514d1ae543ac202073baf27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jan 2025 17:01:07 +0100 Subject: [PATCH 1/5] [Clang] Add -fwrapv-pointer flag GCC supports three flags rela

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #124448)

2025-01-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Can't this use DenseSet? It looks like the names here live for the lifetime of the set. https://github.com/llvm/llvm-project/pull/124448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124430)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix immediate escalation of template function specializations. (PR #124404)

2025-01-27 Thread Nikita Popov via cfe-commits
nikic wrote: FYI this change has some measurable compile-time overhead (about 0.2% for debug builds): https://llvm-compile-time-tracker.com/compare.php?from=eaa5897534cbd263d0cdbf780f72133c2fe8d8d4&to=561132e71b29d9b747dfda1509f715847852f77b&stat=instructions:u Not sure whether that's expected

[clang] [Clang] call HandleImmediateInvocation before checking for immediate escacalating expressions (PR #124414)

2025-01-27 Thread Nikita Popov via cfe-commits
nikic wrote: FYI this one seems like a fairly substantial compile-time regression for C++ code: https://llvm-compile-time-tracker.com/compare_clang.php?from=ad9da92cf6f735747ef04fd56937e1d76819e503&to=5815a311050ae218ebcda53adeee24ed96851943&stat=instructions%3Au&sortBy=interestingness https:/

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-28 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/122486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [flang] [clang] Extend diagnose_if to accept more detailed warning information, take 2 (PR #119712)

2025-01-28 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like one of the header changes here is expensive, adding 0.5% to the time to build clang. Per-file breakdown: https://llvm-compile-time-tracker.com/compare_clang.php?from=aab25f20f6c06bab7aac6fb83d54705ec4cdfadd&to=0865ecc5150b9a55ba1f9e30b6d463a66ac362a6&stat=instructions

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124882)

2025-01-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Nikita Popov via cfe-commits
@@ -1015,7 +1015,7 @@ struct OperandBundleUse { /// has the attribute A. bool operandHasAttr(unsigned Idx, Attribute::AttrKind A) const { if (isDeoptOperandBundle()) - if (A == Attribute::ReadOnly || A == Attribute::NoCapture) nikic wrote: Yes. h

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Nikita Popov via cfe-commits
@@ -526,6 +526,11 @@ static AttributeSet getIntrinsicArgAttributeSet(LLVMContext &C, unsigned ID) { )", ID); for (const CodeGenIntrinsic::ArgAttribute &Attr : Attrs) { +if (Attr.Kind == CodeGenIntrinsic::NoCapture) { nikic wro

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-21 Thread Nikita Popov via cfe-commits
nikic wrote: Thanks for the reviews! I plan to land this after LLVM 20 branches next week, to avoid unnecessary last-minute disruption for the release. https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang-format] First PR to llvm, adding feature for issue (PR #123543)

2025-01-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/123543 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-18 Thread Nikita Popov via cfe-commits
@@ -8,14 +8,14 @@ typedef float v4sf __attribute__ ((__vector_size__ (16))); typedef double v4df __attribute__ ((__vector_size__ (32))); typedef int v4i32 __attribute__ ((__vector_size__ (16))); -// O32-LABEL: define{{.*}} void @test_v4sf(ptr dead_on_unwind noalias nocapture

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123890)

2025-01-22 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125023)

2025-01-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/125023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Migrate away from PointerUnion::dyn_cast (NFC) (#124884) (PR #125024)

2025-01-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/125024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #125022)

2025-01-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/125022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, /// Retrieve the template argument list as written in the sources, /// if any. const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { -if (auto *Info = ExplicitInfo.dyn

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -1391,7 +1391,9 @@ class DeclContextLookupResult { const_iterator end() const { return iterator(); } bool empty() const { return Result.isNull(); } - bool isSingleResult() const { return Result.dyn_cast(); } + bool isSingleResult() const { +return dyn_cast_if_pre

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -885,18 +885,18 @@ class Preprocessor { } ~MacroState() { - if (auto *Info = State.dyn_cast()) + if (auto *Info = dyn_cast_if_present(State)) Info->~ModuleMacroInfo(); } MacroDirective *getLatest() const { - if (auto *Info = State

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, /// Retrieve the template argument list as written in the sources, /// if any. const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { -if (auto *Info = ExplicitInfo.dyn

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124434)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124433)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [IR] Convert from nocapture to captures(none) (PR #123181)

2025-01-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/123181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/122462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122653)

2025-01-13 Thread Nikita Popov via cfe-commits
nikic wrote: > Literal migration would result in dyn_cast_if_present (see the definition of > PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect > Prototype.P to be nonnull. This comment doesn't seem to match the PR :) https://github.com/llvm/llvm-project/pull/122653

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122651)

2025-01-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Analysis] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122652)

2025-01-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122778)

2025-01-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/122462 >From 6940157fa4b9c186f45b98206311b12ab78c40ff Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jan 2025 15:14:44 +0100 Subject: [PATCH 1/2] [Clang] Add release note for pointer overflow optimization cha

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-13 Thread Nikita Popov via cfe-commits
@@ -58,6 +58,26 @@ code bases. containing strict-aliasing violations. The new default behavior can be disabled using ``-fno-pointer-tbaa``. +- Clang will now more aggressively use undefined behavior on pointer addition + overflow for optimization purposes. For example, a

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-13 Thread Nikita Popov via cfe-commits
nikic wrote: > I'm tempted to say we should just treat > -fwrapv/-fwrapv-pointer/-fno-strict-overflow as aliases for each other. I > don't think anyone using -fwrapv is going to be happy that we're turning on > overflow optimizations. Yeah, I'm not entirely sure this change is worthwhile eith

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122854)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: > Literal migration would result in dyn_cast_if_present (see the > definition of PointerUnion::dyn_cast), but this patch uses dyn_cast > because we expect Source to be nonnull. You are still using dyn_cast_if_present :) https://github.com/llvm/llvm-project/pu

[clang] [StaticAnalyzer] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122856)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: This one also uses dyn_cast_if_present. https://github.com/llvm/llvm-project/pull/122856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Avoid repeated map lookups (NFC) (PR #122858)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122855)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122855 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122856)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #122854)

2025-01-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/122854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [llvm] [libclc] Add Maintainers.md for libclc (PR #118309)

2025-01-03 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/118309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123012)

2025-01-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123014)

2025-01-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123013)

2025-01-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [AST] Add OriginalDC argument to ExternalASTSource::FindExternalVisibleDeclsByName (PR #123152)

2025-01-16 Thread Nikita Popov via cfe-commits
nikic wrote: Compile-time looks fine on this one: https://llvm-compile-time-tracker.com/compare.php?from=8fb29ba287d72392bd7900c33d2a8d2149126dbe&to=fd734a392a094a573ee7fe587b9fc5f616f92a9a&stat=instructions:u https://github.com/llvm/llvm-project/pull/123152

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-16 Thread Nikita Popov via cfe-commits
nikic wrote: Thanks for the context! "I'm landing this without approval because I'm the maintainer for this component" is a lot less scary than "I'm landing this without approval because there's no time to wait on a review". https://github.com/llvm/llvm-project/pull/122887

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123158)

2025-01-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123157)

2025-01-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123157 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123156)

2025-01-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-01-10 Thread Nikita Popov via cfe-commits
nikic wrote: I'm concerned about the soundness of our current implementation for these assumptions, see my comment at https://github.com/llvm/llvm-project/pull/120962#issuecomment-2582864870. Not sure we should be exposing the current implementation from clang. https://github.com/llvm/llvm-pr

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Nikita Popov via cfe-commits
@@ -58,6 +58,26 @@ code bases. containing strict-aliasing violations. The new default behavior can be disabled using ``-fno-pointer-tbaa``. +- Clang will now more aggressively use undefined behavior on pointer addition + overflow for optimization purposes. For example, a

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/122462 Add a release note for optimization change related to pointer overflow checks. I've put this in the breaking changes section to give it the best chance of being seen. >From 6940157fa4b9c186f45b98206311b12ab78c40

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/122486 GCC supports three flags related to overflow behavior: * `-fwrapv`: Makes signed integer overflow well-defined. * `-fwrapv-pointer`: Makes pointer overflow well-defined. * `-fno-strict-overflow`: Implies `-fwrap

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/122486 >From 1f3737d2eeb7681cb57a66f7bd6c4614cd038aac Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jan 2025 17:01:07 +0100 Subject: [PATCH] [Clang] Add -fwrapv-pointer flag GCC supports three flags related

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/122486 >From b8c7a369fffecc9d1811d286fb1536346045fb74 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jan 2025 17:01:07 +0100 Subject: [PATCH] [Clang] Add -fwrapv-pointer flag GCC supports three flags related

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/122486 >From b32e3e1eee4b359ae2f0a1563420104de8d52277 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jan 2025 17:01:07 +0100 Subject: [PATCH] [Clang] Add -fwrapv-pointer flag GCC supports three flags related

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Nikita Popov via cfe-commits
@@ -58,6 +58,26 @@ code bases. containing strict-aliasing violations. The new default behavior can be disabled using ``-fno-pointer-tbaa``. +- Clang will now more aggressively use undefined behavior on pointer addition + overflow for optimization purposes. For example, a

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Nikita Popov via cfe-commits
@@ -58,6 +58,26 @@ code bases. containing strict-aliasing violations. The new default behavior can be disabled using ``-fno-pointer-tbaa``. +- Clang will now more aggressively use undefined behavior on pointer addition + overflow for optimization purposes. For example, a

[clang] [Clang] Add release note for pointer overflow optimization change (PR #122462)

2025-01-10 Thread Nikita Popov via cfe-commits
@@ -58,6 +58,26 @@ code bases. containing strict-aliasing violations. The new default behavior can be disabled using ``-fno-pointer-tbaa``. +- Clang will now more aggressively use undefined behavior on pointer addition nikic wrote: I think it's hard to ad

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123283)

2025-01-17 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Avoid repeated hash lookups (NFC) (PR #123285)

2025-01-17 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/123285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BasicAA] Do not decompose past casts with different index width (PR #119365)

2025-01-09 Thread Nikita Popov via cfe-commits
nikic wrote: @frasercrmck BasicAA returns MayAlias for your example. Presumably AMDGPUAA returns NoAlias because addrspace(3) and addrspace(0) can't alias, or something like that. https://github.com/llvm/llvm-project/pull/119365 ___ cfe-commits maili

[clang] [llvm] [BasicAA] Do not decompose past casts with different index width (PR #119365)

2025-01-09 Thread Nikita Popov via cfe-commits
nikic wrote: It's expected that there are regressions if you are mixing pointers with different index widths. I'm open to ideas, but I don't see any obvious way we can fully support pointers with different index widths while also being correct. A key thing that BasicAA needs is the ability to

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-15 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like this change has some compile-time impact even if modules are not used: https://llvm-compile-time-tracker.com/compare.php?from=edc02351dd11cc4a39b7c541b26b71c6f36c8e55&to=7201cae106260aeb3e97d5291ff30f05076a&stat=instructions:u It seems to add about 0.5% to C++ compi

[clang] [clang-scan-deps] Avoid repeated map lookups (NFC) (PR #127023)

2025-02-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/127023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-reorder-fields] Avoid repeated hash lookups (NFC) (PR #127165)

2025-02-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/127165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/125911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,123 @@ +//===- FatLtoCleanup.cpp - clean up IR for the FatLTO pipeline --*- 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] [llvm] [llvm][fatlto] Add FatLTOCleanup pass (PR #125911)

2025-02-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/125911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1e64ea9 - Revert "[CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)"

2025-02-13 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-02-13T14:56:12+01:00 New Revision: 1e64ea9914d3cc839b52e50d2d497600e03c8b6e URL: https://github.com/llvm/llvm-project/commit/1e64ea9914d3cc839b52e50d2d497600e03c8b6e DIFF: https://github.com/llvm/llvm-project/commit/1e64ea9914d3cc839b52e50d2d497600e03c8b6e.diff

[clang] [llvm] [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (PR #125880)

2025-02-13 Thread Nikita Popov via cfe-commits
nikic wrote: Thanks for the report! I've reverted the change for now. ```llvm declare ptr @passthrough(ptr) define i16 @test() { %a = alloca i16, align 1 store i16 1, ptr %a, align 1 %call = call ptr @passthrough(ptr readnone captures(ret: address, provenance) %a) %v = load i16, ptr %

[clang] [CodeGen][Hexagon] Replace PointerType::getUnqual(Type) with opaque version (NFC) (PR #126274)

2025-02-08 Thread Nikita Popov via cfe-commits
@@ -8,6 +8,7 @@ #include "ABIInfoImpl.h" #include "TargetInfo.h" +#include "llvm/IR/DerivedTypes.h" nikic wrote: I don't think the extra include is needed? https://github.com/llvm/llvm-project/pull/126274 ___ cfe-c

[clang] [CodeGen][Hexagon] Replace PointerType::getUnqual(Type) with opaque version (NFC) (PR #126274)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Replace of PointerType::get(Type) with opaque version (NFC) (PR #124771)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/124771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Replace of PointerType::get(Type) with opaque version (NFC) (PR #124771)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/124771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Replace of PointerType::get(Type) with opaque version (NFC) (PR #124771)

2025-02-08 Thread Nikita Popov via cfe-commits
@@ -19,6 +19,8 @@ #include "clang/AST/Type.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/Support/Casting.h" nikic wrote: Shouldn't need the extra includes. https://github.com/llvm/llv

[clang] [Analysis] Avoid repeated hash lookups (NFC) (PR #126378)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ByteCode] Avoid repeated hash lookups (NFC) (PR #126379)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CrossTU] Avoid repeated hash lookups (NFC) (PR #126380)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #126381)

2025-02-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Avoid repeated hash lookups (NFC) (PR #126400)

2025-02-09 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/126400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Avoid repeated map lookups (NFC) (PR #127369)

2025-02-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/127369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid repeated hash lookups (NFC) (PR #127370)

2025-02-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/127370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-21 Thread Nikita Popov via cfe-commits
nikic wrote: > clang/lib/CodeGen/CGBuiltin.cpp is over 1MB long (>23k LoC), and can take > minutes to recompile (depending on compiler and host system) when modified, > and 5 seconds for clangd to update for every edit. Splitting this file was > discussed in this thread: It looks like while t

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-21 Thread Nikita Popov via cfe-commits
nikic wrote: For example, the SPIR builtins file has barely more than 50 lines of code but clocks in at 30M instructions (the *whole* of CGBuiltins.cpp was 120M previously). https://github.com/llvm/llvm-project/pull/132252 ___ cfe-commits mailing lis

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-03-20 Thread Nikita Popov via cfe-commits
@@ -215,6 +221,8 @@ class CGBuilderTy : public CGBuilderBaseTy { /// /// This API assumes that drilling into a struct like this is always an /// inbounds and nuw operation. + /// Specifically, inbounds flag will not be set if \p IsBaseConstantNull is + /// true. ---

[libclc] [libclc] Update license headers (PR #132070)

2025-03-20 Thread Nikita Popov via cfe-commits
@@ -1,24 +1,10 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-03-20 Thread Nikita Popov via cfe-commits
@@ -548,11 +543,28 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, } // Handle floating-point types. + if (!useSoftFloat()) { +// Promote all f16 operations to float, with some exceptions below. +for (unsigned Opc = 0; Opc < ISD::BUILTIN_

<    8   9   10   11   12   13   14   15   16   17   >