#
0768253c |
| 19-Dec-2023 |
Yusra Syeda <99052248+ysyeda@users.noreply.github.com> |
[SystemZ][z/OS] Add exception handling for XPLINK (#74638)
Adds emitting the exception table and the EH registers for XPLINK.
---------
Co-authored-by: Yusra Syeda <yusra.syeda@ibm.com>
|
#
239a41e8 |
| 14-Dec-2023 |
Arthur Eubanks <aeubanks@google.com> |
Re-Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use 32 bit constants.
Re-Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use 32 bit constants.
For GlobalValue references, use TargetMachine::isLargeGlobalObject(). Look through aliases for determining if a GlobalValue is small or large. Even the large code model can reference small objects with 32 bit constants as long as we're in no-pic mode, or if the reference is offset from the GOT.
Original commit broke the build...
First reland broke large PIC builds referencing small data since it was using GOTOFF as a 32-bit constant.
show more ...
|
#
15617d14 |
| 14-Dec-2023 |
Arthur Eubanks <aeubanks@google.com> |
Revert "Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)"
This reverts commit ec92d74a0ef89b9dd46aee6ec8aca6bfd3c66a54.
Breaks some compiler-
Revert "Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)"
This reverts commit ec92d74a0ef89b9dd46aee6ec8aca6bfd3c66a54.
Breaks some compiler-rt tests, e.g. https://lab.llvm.org/buildbot/#/builders/37/builds/28834
show more ...
|
#
ab3430f8 |
| 14-Dec-2023 |
Zequan Wu <zequanwu@google.com> |
[Profile] Add binary profile correlation for code coverage. (#69493)
## Motivation
Since we don't need the metadata sections at runtime, we can somehow
offload them from memory at runtime. Initial
[Profile] Add binary profile correlation for code coverage. (#69493)
## Motivation
Since we don't need the metadata sections at runtime, we can somehow
offload them from memory at runtime. Initially, I explored [debug info
correlation](https://discourse.llvm.org/t/instrprofiling-lightweight-instrumentation/59113),
which is used for PGO with value profiling disabled. However, it
currently only works with DWARF and it's be hard to add such artificial
debug info for every function in to CodeView which is used on Windows.
So, offloading profile metadata sections at runtime seems to be a
platform independent option.
## Design
The idea is to use new section names for profile name and data sections
and mark them as metadata sections. Under this mode, the new sections
are non-SHF_ALLOC in ELF. So, they are not loaded into memory at runtime
and can be stripped away as a post-linking step. After the process
exits, the generated raw profiles will contains only headers + counters.
llvm-profdata can be used correlate raw profiles with the unstripped
binary to generate indexed profile.
## Data
For chromium base_unittests with code coverage on linux, the binary size
overhead due to instrumentation reduced from 64M to 38.8M (39.4%) and
the raw profile files size reduce from 128M to 68M (46.9%)
```
$ bloaty out/cov/base_unittests.stripped -- out/no-cov/base_unittests.stripped
FILE SIZE VM SIZE
-------------- --------------
+121% +30.4Mi +121% +30.4Mi .text
[NEW] +14.6Mi [NEW] +14.6Mi __llvm_prf_data
[NEW] +10.6Mi [NEW] +10.6Mi __llvm_prf_names
[NEW] +5.86Mi [NEW] +5.86Mi __llvm_prf_cnts
+95% +1.75Mi +95% +1.75Mi .eh_frame
+108% +400Ki +108% +400Ki .eh_frame_hdr
+9.5% +211Ki +9.5% +211Ki .rela.dyn
+9.2% +95.0Ki +9.2% +95.0Ki .data.rel.ro
+5.0% +87.3Ki +5.0% +87.3Ki .rodata
[ = ] 0 +13% +47.0Ki .bss
+40% +1.78Ki +40% +1.78Ki .got
+12% +1.49Ki +12% +1.49Ki .gcc_except_table
[ = ] 0 +65% +1.23Ki .relro_padding
+62% +1.20Ki [ = ] 0 [Unmapped]
+13% +448 +19% +448 .init_array
+8.8% +192 [ = ] 0 [ELF Section Headers]
+0.0% +136 +0.0% +80 [7 Others]
+0.1% +96 +0.1% +96 .dynsym
+1.2% +96 +1.2% +96 .rela.plt
+1.5% +80 +1.2% +64 .plt
[ = ] 0 -99.2% -3.68Ki [LOAD #5 [RW]]
+195% +64.0Mi +194% +64.0Mi TOTAL
$ bloaty out/cov-cor/base_unittests.stripped -- out/no-cov/base_unittests.stripped
FILE SIZE VM SIZE
-------------- --------------
+121% +30.4Mi +121% +30.4Mi .text
[NEW] +5.86Mi [NEW] +5.86Mi __llvm_prf_cnts
+95% +1.75Mi +95% +1.75Mi .eh_frame
+108% +400Ki +108% +400Ki .eh_frame_hdr
+9.5% +211Ki +9.5% +211Ki .rela.dyn
+9.2% +95.0Ki +9.2% +95.0Ki .data.rel.ro
+5.0% +87.3Ki +5.0% +87.3Ki .rodata
[ = ] 0 +13% +47.0Ki .bss
+40% +1.78Ki +40% +1.78Ki .got
+12% +1.49Ki +12% +1.49Ki .gcc_except_table
+13% +448 +19% +448 .init_array
+0.1% +96 +0.1% +96 .dynsym
+1.2% +96 +1.2% +96 .rela.plt
+1.2% +64 +1.2% +64 .plt
+2.9% +64 [ = ] 0 [ELF Section Headers]
+0.0% +40 +0.0% +40 .data
+1.2% +32 +1.2% +32 .got.plt
+0.0% +24 +0.0% +8 [5 Others]
[ = ] 0 -22.9% -872 [LOAD #5 [RW]]
-74.5% -1.44Ki [ = ] 0 [Unmapped]
[ = ] 0 -76.5% -1.45Ki .relro_padding
+118% +38.8Mi +117% +38.8Mi TOTAL
```
A few things to note:
1. llvm-profdata doesn't support filter raw profiles by binary id yet,
so when a raw profile doesn't belongs to the binary being digested by
llvm-profdata, merging will fail. Once this is implemented,
llvm-profdata should be able to only merge raw profiles with the same
binary id as the binary and discard the rest (with mismatched/missing
binary id). The workflow I have in mind is to have scripts invoke
llvm-profdata to get all binary ids for all raw profiles, and
selectively choose the raw pnrofiles with matching binary id and the
binary to llvm-profdata for merging.
2. Note: In COFF, currently they are still loaded into memory but not
used. I didn't do it in this patch because I noticed that `.lcovmap` and
`.lcovfunc` are loaded into memory. A separate patch will address it.
3. This should works with PGO when value profiling is disabled as debug
info correlation currently doing, though I haven't tested this yet.
show more ...
|
#
ec92d74a |
| 14-Dec-2023 |
Arthur Eubanks <aeubanks@google.com> |
Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use 32 bit constants.
F
Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use 32 bit constants.
For GlobalValue references, use TargetMachine::isLargeGlobalObject(). Look through aliases for determining if a GlobalValue is small or large. Even the large code model can reference small objects with 32 bit constants as long as we're in no-pic mode, or if the reference is offset from the GOT.
Original commit broke the build...
show more ...
|
#
f0c03da6 |
| 14-Dec-2023 |
Arthur Eubanks <aeubanks@google.com> |
Revert "[X86] Respect code models more when determining if a global reference can fit in 32 bits" (#75500)
Reverts llvm/llvm-project#75386
Breaks build.
|
#
5e38ba26 |
| 14-Dec-2023 |
Arthur Eubanks <aeubanks@google.com> |
[X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use
32 bit constants.
For G
[X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
For non-GlobalValue references, the small and medium code models can use
32 bit constants.
For GlobalValue references, use TargetMachine::isLargeGlobalObject().
Look through aliases for determining if a GlobalValue is small or large.
Even the large code model can reference small objects with 32 bit
constants as long as we're in no-pic mode, or if the reference is offset
from the GOT.
show more ...
|
#
586ecdf2 |
| 12-Dec-2023 |
Kazu Hirata <kazu@google.com> |
[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::
[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.
I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
show more ...
|
#
cc4ecfd6 |
| 09-Dec-2023 |
Kazu Hirata <kazu@google.com> |
[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_w
[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20. Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.
show more ...
|
#
8f6f5ec7 |
| 08-Dec-2023 |
Maryam Moghadas <34670902+maryammo@users.noreply.github.com> |
[PowerPC] Move __ehinfo TOC entries to the end of the TOC section (#73586)
On AIX, the __ehinfo toc-entry is never referenced directly using
instructions, therefore we can allocate them with the TE
[PowerPC] Move __ehinfo TOC entries to the end of the TOC section (#73586)
On AIX, the __ehinfo toc-entry is never referenced directly using
instructions, therefore we can allocate them with the TE storage mapping
class to move them to the end of TOC.
show more ...
|
#
d8a04398 |
| 28-Nov-2023 |
Arthur Eubanks <aeubanks@google.com> |
Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the way of the rest of the binary.
T
Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the way of the rest of the binary.
This is useful for mixing precompiled small code model object files and built-from-source large code model binaries so that the the text sections don't get merged.
The reland fixes an issue where a function in the large code model would reference small data without GOTOFF.
This was incorrectly reverted in 76f78ecc789d58baa3a88b2fe2a57428f07e5362.
show more ...
|
#
76f78ecc |
| 01-Dec-2023 |
Dmitri Gribenko <gribozavr@gmail.com> |
Revert "Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)"
This reverts commit 4bf8a688956a759b7b6b8d94f42d25c13c7af130.
This commit seems to be breakin
Revert "Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)"
This reverts commit 4bf8a688956a759b7b6b8d94f42d25c13c7af130.
This commit seems to be breaking the semantics of the ObjectFile::isSectionText method, which breaks numba/llvmlite bindings.
show more ...
|
#
4bf8a688 |
| 28-Nov-2023 |
Arthur Eubanks <aeubanks@google.com> |
Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the way of the rest of the binary.
T
Reland [X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the way of the rest of the binary.
This is useful for mixing precompiled small code model object files and built-from-source large code model binaries so that the the text sections don't get merged.
The reland fixes an issue where a function in the large code model would reference small data without GOTOFF.
show more ...
|
#
d8d9394c |
| 28-Nov-2023 |
Arthur Eubanks <aeubanks@google.com> |
Revert "[X86] With large code model, put functions into .ltext with large section flag (#73037)"
This reverts commit 38e435895779c6f0e6c47a171f3b300ad99828b3.
May be culprit for https://lab.llvm.or
Revert "[X86] With large code model, put functions into .ltext with large section flag (#73037)"
This reverts commit 38e435895779c6f0e6c47a171f3b300ad99828b3.
May be culprit for https://lab.llvm.org/buildbot/#/builders/37/builds/28079/steps/9/logs/stdio.
show more ...
|
#
38e43589 |
| 28-Nov-2023 |
Arthur Eubanks <aeubanks@google.com> |
[X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the
way of the rest of the binary.
This
[X86] With large code model, put functions into .ltext with large section flag (#73037)
So that when mixing small and large text, large text stays out of the
way of the rest of the binary.
This is useful for mixing precompiled small code model object files and
built-from-source large code model binaries so that the the text
sections don't get merged.
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
db7a1ed9 |
| 31-Oct-2023 |
Zequan Wu <zequanwu@google.com> |
Revert "[Profile] Refactor profile correlation. (#70712)"
This reverts commit 4b383d0af93136b80841fc140da0823dfc441dd4.
|
#
4b383d0a |
| 31-Oct-2023 |
Zequan Wu <zequanwu@google.com> |
[Profile] Refactor profile correlation. (#70712)
Refactor some code from https://github.com/llvm/llvm-project/pull/69493.
Rebase of https://github.com/llvm/llvm-project/pull/69656 on top of main
[Profile] Refactor profile correlation. (#70712)
Refactor some code from https://github.com/llvm/llvm-project/pull/69493.
Rebase of https://github.com/llvm/llvm-project/pull/69656 on top of main
as it was messed up.
show more ...
|
Revision tags: llvmorg-17.0.4 |
|
#
f3ea7313 |
| 18-Oct-2023 |
Arthur Eubanks <aeubanks@google.com> |
[ELF] Set large section flag for globals with an explicit section (#69396)
An oversight in https://reviews.llvm.org/D148836 since this is a
different code path.
|
Revision tags: llvmorg-17.0.3, llvmorg-17.0.2 |
|
#
897a0b01 |
| 22-Sep-2023 |
Rahman Lavaee <rahmanl@google.com> |
[BasicBlockSections] Split cold parts of custom-section functions. (#66731)
This PR makes `-basic-block-sections` handle functions with custom
non-dot-text sections correctly. Cold parts of such fu
[BasicBlockSections] Split cold parts of custom-section functions. (#66731)
This PR makes `-basic-block-sections` handle functions with custom
non-dot-text sections correctly. Cold parts of such functions must be
placed in the same section (not in `.text.split`) but with a unique id.
show more ...
|
Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4 |
|
#
1feb00a2 |
| 10-May-2023 |
Arthur Eubanks <aeubanks@google.com> |
[X86] Introduce a large data threshold for the medium code model
Currently clang's medium code model treats all data as large, putting them in a large data section and using more expensive instructi
[X86] Introduce a large data threshold for the medium code model
Currently clang's medium code model treats all data as large, putting them in a large data section and using more expensive instruction sequences to access them.
Following gcc's -mlarge-data-threshold, which allows putting data under a certain size in a normal data section as opposed to a large data section. This allows using cheaper code sequences to access some portion of data in the binary (which will be implemented in LLVM in a future patch).
And under the medium codel mode, only put data above the large data threshold into large data sections, not all data.
Reviewed By: MaskRay, rnk
Differential Revision: https://reviews.llvm.org/D149288
show more ...
|
#
9d4e8c09 |
| 26-Jul-2023 |
Wael Yehia <wyehia@ca.ibm.com> |
[XCOFF] Do not put MergeableCStrings in their own section
The current implementation generates a csect with a ".rodata.str.x.y" prefix for a MergeableCString variable definition. However, a referenc
[XCOFF] Do not put MergeableCStrings in their own section
The current implementation generates a csect with a ".rodata.str.x.y" prefix for a MergeableCString variable definition. However, a reference to such variable does not get the prefix in its name because there's not enough information in the containing IR. In particular, without seeing the initializer and absent of some other indicators, we cannot tell that the referenced variable is a null- terminated string.
When the AIX codegen in llvm was being developed, the prefixing was copied from ELF without having the linker take advantage of the info. Currently, the AIX linker does not have the capability to merge MergeableCString variables. If such feature would ever get implemented, the contract between the linker and compiler would have to be reconsidered.
Here's the before and after of this change: ``` @a = global i64 320255973571806, align 8 @strA = unnamed_addr constant [7 x i8] c"hello\0A\00", align 1 ;; Mergeable1ByteCString @strB = unnamed_addr constant [8 x i8] c"Blahah\0A\00", align 1 ;; Mergeable1ByteCString @strC = unnamed_addr constant [2 x i16] [i16 1, i16 0], align 2 ;; Mergeable2ByteCString @strD = unnamed_addr constant [2 x i16] [i16 1, i16 1], align 2 ;; !isMergeableCString @strE = external unnamed_addr constant [2 x i16], align 2
-fdata-sections: .text extern .rodata.str1.1strA .text extern strA 0 SD RO 0 SD RO .text extern .rodata.str1.1strB .text extern strB 0 SD RO 0 SD RO .text extern .rodata.str2.2strC ===> .text extern strC 0 SD RO 0 SD RO .text extern strD .text extern strD 0 SD RO 0 SD RO .data extern a .data extern a 0 SD RW 0 SD RW undef extern strE undef extern strE 0 ER UA 0 ER UA
-fno-data-sections: .text unamex .rodata.str1.1 .text unamex .rodata 0 SD RO 0 SD RO .text extern strA .text extern strA 0 LD RO 0 LD RO .text extern strB .text extern strB 0 LD RO 0 LD RO .text unamex .rodata.str2.2 ===> .text extern strC 0 SD RO 0 LD RO .text extern strC .text extern strD 0 LD RO 0 LD RO .text unamex .rodata .data unamex .data 0 SD RO 0 SD RW .text extern strD .data extern a 0 LD RO 0 LD RW .data unamex .data undef extern strE 0 SD RW 0 ER UA .data extern a 0 LD RW undef extern strE 0 ER UA ```
Reviewed by: David Tenty, Fangrui Song
Differential Revision: https://reviews.llvm.org/D156202
show more ...
|
#
e83b8a5e |
| 26-Jul-2023 |
esmeyi <esme.yi@ibm.com> |
[XCOFF] Enable available_externally linkage for functions.
Summary: D80642 added support for emitting AvailableExternally Linkage on AIX. However, an assertion of "Trying to get csect representation
[XCOFF] Enable available_externally linkage for functions.
Summary: D80642 added support for emitting AvailableExternally Linkage on AIX. However, an assertion of "Trying to get csect representation of this symbol but none was set." occurred when a function is declared as available_externally. This is due to we missing to generate a csect for the function. This patch fixes it.
Reviewed By: hubert.reinterpretcast, shchenz
Differential Revision: https://reviews.llvm.org/D156213
Signed-off-by: Esme Yi <esme.yi@ibm.com>
show more ...
|
#
2dea969d |
| 24-Jul-2023 |
Antonio Frighetto <me@antoniofrighetto.com> |
[clang][CodeGen] Introduce `-frecord-command-line` for MachO
Allow clang driver command-line recording when targeting MachO object files as well.
Reviewed-by: sgraenitz
Differential Revision: http
[clang][CodeGen] Introduce `-frecord-command-line` for MachO
Allow clang driver command-line recording when targeting MachO object files as well.
Reviewed-by: sgraenitz
Differential Revision: https://reviews.llvm.org/D155716
show more ...
|
#
43249378 |
| 10-May-2023 |
Arthur Eubanks <aeubanks@google.com> |
[X86] Use "l" prefix for data sections under medium/large code model
And also set the SHF_X86_64_LARGE section flag.
gcc only uses the "l" prefix and SHF_X86_64_LARGE in the medium code model for d
[X86] Use "l" prefix for data sections under medium/large code model
And also set the SHF_X86_64_LARGE section flag.
gcc only uses the "l" prefix and SHF_X86_64_LARGE in the medium code model for data larger than -mlarge-data-threshold. But it seems more consistent to use it in the large code model as well in case separate parts of the binary aren't compiled with the large code model and also have a .data/.bss/.rodata section.
Reviewed By: MaskRay, tkoeppe
Differential Revision: https://reviews.llvm.org/D148836
show more ...
|
Revision tags: llvmorg-16.0.3 |
|
#
c3f0153e |
| 21-Apr-2023 |
Julian Lettner <julian.lettner@apple.com> |
[MachO] Disable atexit()-based lowering when LTO'ing kernel/kext code
The kernel and kext environments do not provide the `__cxa_atexit()` function, so we can't use it for lowering global module des
[MachO] Disable atexit()-based lowering when LTO'ing kernel/kext code
The kernel and kext environments do not provide the `__cxa_atexit()` function, so we can't use it for lowering global module destructors.
Unfortunately, just querying for "compiling for kernel/kext?" in the LTO pipeline isn't possible (kernel/kext identifier isn't part of the triple yet) so we need to pass down a CodeGen flag.
rdar://93536111
Differential Revision: https://reviews.llvm.org/D148967
show more ...
|