[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek closed https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/5] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Petr Hosek via cfe-commits
@@ -221,6 +221,11 @@ New Compiler Flags - ``-fexperimental-modules-reduced-bmi`` enables the Reduced BMI for C++20 named modules. See the document of standard C++ modules for details. +- ``-fseparate-named-sections`` uses separate unique sections for global + symbols in na

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Petr Hosek via cfe-commits
@@ -277,6 +277,8 @@ namespace llvm { /// Use unique names for basic block sections. unsigned UniqueBasicBlockSectionNames : 1; +unsigned SeparateNamedSections : 1; petrhosek wrote: Done https://github.com/llvm/llvm-project/pull/91028

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/5] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Peter Smith via cfe-commits
@@ -277,6 +277,8 @@ namespace llvm { /// Use unique names for basic block sections. unsigned UniqueBasicBlockSectionNames : 1; +unsigned SeparateNamedSections : 1; smithp35 wrote: Almost all of the other flags have Doxygen comments. Worth somethin

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Peter Smith via cfe-commits
@@ -221,6 +221,11 @@ New Compiler Flags - ``-fexperimental-modules-reduced-bmi`` enables the Reduced BMI for C++20 named modules. See the document of standard C++ modules for details. +- ``-fseparate-named-sections`` uses separate unique sections for global + symbols in na

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Peter Smith via cfe-commits
https://github.com/smithp35 commented: Thanks for working on this! Just a couple of small comment suggestions from me. https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-07 Thread Peter Smith via cfe-commits
https://github.com/smithp35 edited https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -0,0 +1,36 @@ +; Test that global values with explicit sections are placed into unique sections. + +; RUN: llc < %s 2>&1 | FileCheck %s petrhosek wrote: Done. https://github.com/llvm/llvm-project/pull/91028 ___ cfe

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -733,16 +733,22 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName, Ctx.isELFGenericMergeableSection(SectionName); // If this is the first ocurrence of this section name, treat it as the // generic section - if (!SymbolMergeable && !S

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/4] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
petrhosek wrote: > > This is an alternative approach to address the issue described in > > [discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570](https://discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570) > > which doesn't require a custom section type. > > This RFC

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -733,16 +733,22 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName, Ctx.isELFGenericMergeableSection(SectionName); // If this is the first ocurrence of this section name, treat it as the // generic section - if (!SymbolMergeable && !S

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,36 @@ +; Test that global values with explicit sections are placed into unique sections. + +; RUN: llc < %s 2>&1 | FileCheck %s MaskRay wrote: Drop unused `2>&1` https://github.com/llvm/llvm-project/pull/91028

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -75,6 +75,10 @@ static cl::opt JumpTableInFunctionSection( "jumptable-in-function-section", cl::Hidden, cl::init(false), cl::desc("Putting Jump Table in function section")); +static cl::opt UniqueExplicitSections( +"unique-explicit-sections", cl::Hidden, cl::ini

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/3] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) Changes When set, the compiler will use separate unique sections for global symbols in named special sections (e.g. symbols that are annotated with __attribute__((section(.... Doing so enables linker GC to colle

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/2] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -75,6 +75,10 @@ static cl::opt JumpTableInFunctionSection( "jumptable-in-function-section", cl::Hidden, cl::init(false), cl::desc("Putting Jump Table in function section")); +static cl::opt UniqueExplicitSections( +"unique-explicit-sections", cl::Hidden, cl::ini

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: > This is an alternative approach to address the issue described in > [discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570](https://discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570) > which doesn't require a custom section type. This RFC is about `SH

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-03 Thread Petr Hosek via cfe-commits
petrhosek wrote: This is an alternative approach to address the issue described in https://discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570 which doesn't require a custom section type. https://github.com/llvm/llvm-project/pull/91028 _

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-03 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/91028 When set, the compiler will use separate unique sections for global symbols in named special sections (e.g. symbols that are annotated with __attribute__((section(.... Doing so enables linker GC to collect