Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
283dca56 |
| 13-Jan-2025 |
Daniel Paoliello <danpao@microsoft.com> |
Reapply "[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)" (#122777)
This reverts commit 2f7ade4b5e399962e18f5f9a0ab0b7335deece51.
Fi
Reapply "[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)" (#122777)
This reverts commit 2f7ade4b5e399962e18f5f9a0ab0b7335deece51.
Fix is available in #122762
show more ...
|
#
2f7ade4b |
| 13-Jan-2025 |
Kirill Stoimenov <kstoimenov@google.com> |
Revert "[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)"
Breaks sanitizer build: https://lab.llvm.org/buildbot/#/builders/52/builds/5
Revert "[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)"
Breaks sanitizer build: https://lab.llvm.org/buildbot/#/builders/52/builds/5179
This reverts commits: 5ee0a71df919a328c714e25f0935c21e586cc18b d997a722c194feec5f3a94dec5acdce59ac5e55b
show more ...
|
#
5ee0a71d |
| 12-Jan-2025 |
Daniel Paoliello <danpao@microsoft.com> |
[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)
This change implements import call optimization for AArch64 Windows (equivalent to th
[aarch64][win] Add support for import call optimization (equivalent to MSVC /d2ImportCallOptimization) (#121516)
This change implements import call optimization for AArch64 Windows (equivalent to the undocumented MSVC `/d2ImportCallOptimization` flag).
Import call optimization adds additional data to the binary which can be used by the Windows kernel loader to rewrite indirect calls to imported functions as direct calls. It uses the same [Dynamic Value Relocation Table mechanism that was leveraged on x64 to implement `/d2GuardRetpoline`](https://techcommunity.microsoft.com/blog/windowsosplatform/mitigating-spectre-variant-2-with-retpoline-on-windows/295618).
The change to the obj file is to add a new `.impcall` section with the following layout: ```cpp // Per section that contains calls to imported functions: // uint32_t SectionSize: Size in bytes for information in this section. // uint32_t Section Number // Per call to imported function in section: // uint32_t Kind: the kind of imported function. // uint32_t BranchOffset: the offset of the branch instruction in its // parent section. // uint32_t TargetSymbolId: the symbol id of the called function. ```
NOTE: If the import call optimization feature is enabled, then the `.impcall` section must be emitted, even if there are no calls to imported functions.
The implementation is split across a few parts of LLVM: * During AArch64 instruction selection, the `GlobalValue` for each call to a global is recorded into the Extra Information for that node. * During lowering to machine instructions, the called global value for each call is noted in its containing `MachineFunction`. * During AArch64 asm printing, if the import call optimization feature is enabled: - A (new) `.impcall` directive is emitted for each call to an imported function. - The `.impcall` section is emitted with its magic header (but is not filled in). * During COFF object writing, the `.impcall` section is filled in based on each `.impcall` directive that were encountered.
The `.impcall` section can only be filled in when we are writing the COFF object as it requires the actual section numbers, which are only assigned at that point (i.e., they don't exist during asm printing).
I had tried to avoid using the Extra Information during instruction selection and instead implement this either purely during asm printing or in a `MachineFunctionPass` (as suggested in [on the forums](https://discourse.llvm.org/t/design-gathering-locations-of-instructions-to-emit-into-a-section/83729/3)) but this was not possible due to how loading and calling an imported function works on AArch64. Specifically, they are emitted as `ADRP` + `LDR` (to load the symbol) then a `BR` (to do the call), so at the point when we have machine instructions, we would have to work backwards through the instructions to discover what is being called. An initial prototype did work by inspecting instructions; however, it didn't correctly handle the case where the same function was called twice in a row, which caused LLVM to elide the `ADRP` + `LDR` and reuse the previously loaded address. Worse than that, sometimes for the double-call case LLVM decided to spill the loaded address to the stack and then reload it before making the second call. So, instead of trying to implement logic to discover where the value in a register came from, I instead recorded the symbol being called at the last place where it was easy to do: instruction selection.
show more ...
|
Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
2b077ede |
| 13-Aug-2024 |
Alexis Engelke <engelke@in.tum.de> |
[MC] Avoid useless triple copy (#103026)
Copying a triple is cheap, but not free, so let's not do that if there's
no reason to do so. Trivial cleanup.
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
f138b33d |
| 22-Jul-2024 |
Chen Zheng <czhengsz@cn.ibm.com> |
[XCOFF] refactor the XCOFF BeginSymName handling
Fixes #96810
|
#
04c27852 |
| 25-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC,COFF] Change how we handle section symbols
13a79bbfe583e1d8cc85d241b580907260065eb8 (2017) unified `BeginSymbol` and section symbol for ELF. This patch does the same for COFF.
* In getCOFFSecti
[MC,COFF] Change how we handle section symbols
13a79bbfe583e1d8cc85d241b580907260065eb8 (2017) unified `BeginSymbol` and section symbol for ELF. This patch does the same for COFF.
* In getCOFFSection, all sections now have a `BeginSymbol` (section symbol). We do not need a dummy symbol name when `getBeginSymbol` is needed (used by AsmParser::Run and DWARF generation). * Section symbols are in the global symbol table. `call .text` will reference the section symbol instead of an undefined symbol. This matches GNU assembler. Unlike GNU, redefining the section symbol will cause a "symbol 'foo0' is already defined" error (see `section-sym-err.s`).
Pull Request: https://github.com/llvm/llvm-project/pull/96459
show more ...
|
#
a3cf14af |
| 23-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC,COFF] Remove unneeded BeginSymName
When `BeginSymName` is not null, `createTempSymbol` is called but the created symbol is not attached to a fragment. This is used as a hack to some DWARF tests
[MC,COFF] Remove unneeded BeginSymName
When `BeginSymName` is not null, `createTempSymbol` is called but the created symbol is not attached to a fragment. This is used as a hack to some DWARF tests to work. In the future, we should repurpose `BeginSymbol` as the section symbol in ELF.
show more ...
|
#
95f983f8 |
| 23-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Change Subsection parameters from const MCExpr * to uint32_t
Follow-up to 05ba5c0648ae5e80d5afce270495bf3b1eef9af4. uint32_t is preferred over const MCExpr * in the section stack uses because i
[MC] Change Subsection parameters from const MCExpr * to uint32_t
Follow-up to 05ba5c0648ae5e80d5afce270495bf3b1eef9af4. uint32_t is preferred over const MCExpr * in the section stack uses because it should only be evaluated once. Change the paramter type to match.
show more ...
|
#
46beeaa3 |
| 20-Jun-2024 |
aengelke <engelke@in.tum.de> |
[MC] Remove SectionKind from MCSection (#96067)
There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store othe
[MC] Remove SectionKind from MCSection (#96067)
There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.
ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.
This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.
show more ...
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6 |
|
#
8f212948 |
| 08-May-2024 |
YunQiang Su <syq@debian.org> |
MIPS: Use pcrel|sdata4 for eh_frame (#91291)
Gas uses encoding DW_EH_PE_absptr for PIC, and gnu ld converts it to
DW_EH_PE_sdata4|DW_EH_PE_pcrel.
LLD doesn't have this workarounding, thus complain
MIPS: Use pcrel|sdata4 for eh_frame (#91291)
Gas uses encoding DW_EH_PE_absptr for PIC, and gnu ld converts it to
DW_EH_PE_sdata4|DW_EH_PE_pcrel.
LLD doesn't have this workarounding, thus complains
```
relocation R_MIPS_32 cannot be used against local symbol; recompile with -fPIC
relocation R_MIPS_64 cannot be used against local symbol; recompile with -fPIC
```
So, let's generates asm/obj files with `DW_EH_PE_sdata4|DW_EH_PE_pcrel`
encoding. In fact, GNU ld supports such OBJs well.
For N64, maybe we should use sdata8, while GNU ld doesn't support it
well, and in fact sdata4 is enough now. So we just ignore the `Large`
for `MCObjectFileInfo::initELFMCObjectFileInfo`. Maybe we should switch
back to sdata8 once GNU LD supports it well.
Fixes: #58377.
show more ...
|
Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
#
eccc7178 |
| 05-Mar-2024 |
Neumann Hon <neumann.hon@ibm.com> |
[SystemZ] [z/OS] Emit offset to PPA2 in separate MCSection (#84043)
The ppa2list section isn't really part of the ppa2 section. The ppa2list
section contains the offset to the ppa2, and must be cre
[SystemZ] [z/OS] Emit offset to PPA2 in separate MCSection (#84043)
The ppa2list section isn't really part of the ppa2 section. The ppa2list
section contains the offset to the ppa2, and must be created with a
special section name (specifically, C_@@QPPA2). The binder searches for
a section with this name, then uses this value to locate the ppa2.
In GOFF terms, these are entirely separate sections; the PPA2 section
isn't even really a section but rather belongs to the code section. On
the other hand, the ppa2list section is a section in its own right and
resides in a separate TXT record.
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
735adbf1 |
| 17-Jan-2024 |
Cyndy Ishida <cyndy_ishida@apple.com> |
[llvm] Teach MachO about XROS (#78373)
Add support for XROS to encode in Mach-O file formats.
|
#
4b1254e7 |
| 04-Dec-2023 |
stephenpeckham <118857872+stephenpeckham@users.noreply.github.com> |
[AIX] In assembly file, create a dummy text renamed to an empty string (#73052)
This works around an AIX assembler and linker bug. If the
-fno-integrated-as and -frecord-command-line options are us
[AIX] In assembly file, create a dummy text renamed to an empty string (#73052)
This works around an AIX assembler and linker bug. If the
-fno-integrated-as and -frecord-command-line options are used but
there's no actual code in the source file, the assembler creates an
object file with only an .info section. The AIX linker rejects such an
object file.
show more ...
|
Revision tags: llvmorg-17.0.6 |
|
#
9a38a72f |
| 27-Nov-2023 |
Yusra Syeda <99052248+ysyeda@users.noreply.github.com> |
[SystemZ][z/OS] This change adds support for the PPA2 section in zOS (#68926)
This PR adds support for the PPA2 fields.
---------
Co-authored-by: Yusra Syeda <yusra.syeda@ibm.com>
|
Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, 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 |
|
#
62a1fbe9 |
| 21-Jul-2023 |
Jon Roelofs <jonathan_roelofs@apple.com> |
Enable compact unwind in all darwin simulators
... since they've always supported it.
rdar://104359594
Differential revision: https://reviews.llvm.org/D155988
|
#
ac5d5351 |
| 13-Jul-2023 |
Stephen Peckham <speckham@us.ibm.com> |
Use empty symbol name for XCOFF text csect
When generating XCOFF, the compiler generates a csect with an internal name. Each function results in a label within the csect. This patch replaces the i
Use empty symbol name for XCOFF text csect
When generating XCOFF, the compiler generates a csect with an internal name. Each function results in a label within the csect. This patch replaces the internal name ".text" with an empty string "". This avoids adding special code to handle a function text() in the source file, and works better with some XCOFF tools that are confused when the csect and the first function have the same address.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D154854
show more ...
|
#
163aad6b |
| 05-Jul-2023 |
Yusra Syeda <yusra.syeda@ibm.com> |
[SystemZ][z/OS] z/OS ADA codegen and emission
This patch adds support for the ADA (associated data area), doing the following:
-Creates the ADA table to handle displacements -Emits the ADA section
[SystemZ][z/OS] z/OS ADA codegen and emission
This patch adds support for the ADA (associated data area), doing the following:
-Creates the ADA table to handle displacements -Emits the ADA section in the SystemZAsmPrinter -Lowers the ADA_ENTRY node into the appropriate load instruction
Differential Revision: https://reviews.llvm.org/D153788
show more ...
|
#
1bfdc534 |
| 28-Jun-2023 |
Yusra Syeda <yusra.syeda@ibm.com> |
Revert "[SystemZ][z/OS] This patch adds support for the ADA (associated data area), doing the following:"
This reverts commit 9df0f66af5462e23216eae31aedbd4d2f459cc3d.
|
#
9df0f66a |
| 28-Jun-2023 |
Yusra Syeda <yusra.syeda@ibm.com> |
[SystemZ][z/OS] This patch adds support for the ADA (associated data area), doing the following: - Creates the ADA table to handle displacements - Emits the ADA section in the SystemZAsmPrinter - Low
[SystemZ][z/OS] This patch adds support for the ADA (associated data area), doing the following: - Creates the ADA table to handle displacements - Emits the ADA section in the SystemZAsmPrinter - Lowers the ADA_ENTRY node into the appropriate load instruction
Differential Revision: https://reviews.llvm.org/D153788
show more ...
|
#
17202379 |
| 21-Jun-2023 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Do not emit a named symbol to denote the start of the debug_frame section
When emitting a debug_frame section, it contains a named symbol.
> echo "void foo(void) {}" | clang -arch arm64 -ffreestan
Do not emit a named symbol to denote the start of the debug_frame section
When emitting a debug_frame section, it contains a named symbol.
> echo "void foo(void) {}" | clang -arch arm64 -ffreestanding -g -c -o \ /tmp/test.o -x c - > nm /tmp/test.o -s __DWARF __debug_frame 0000000000000200 s ltmp1
There are no such symbols emitted in any of the other DWARF sections, this is because when the __debug_frame section is created, it doesn't get a `BeginSymName` and so it creates a named symbol, such as `ltmp1` and emits it when we switch to the section in MCDwarf.cpp.
This patch fixes the above issue.
Differential Revision: https://reviews.llvm.org/D153484
show more ...
|
#
cb26c1c7 |
| 26-Jun-2023 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Revert "Do not emit a named symbol to denote the start of the debug_frame section"
This reverts commit d6576add99e5ebf936f836aa3ecdc85deb33687e.
Reverted because
BUILD FAILED: failed 41960 expecte
Revert "Do not emit a named symbol to denote the start of the debug_frame section"
This reverts commit d6576add99e5ebf936f836aa3ecdc85deb33687e.
Reverted because
BUILD FAILED: failed 41960 expected passes 86 expected failures 28788 unsupported tests 1 unexpected failures (failure)
show more ...
|
#
d6576add |
| 21-Jun-2023 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Do not emit a named symbol to denote the start of the debug_frame section
When emitting a debug_frame section, it contains a named symbol.
> echo "void foo(void) {}" | clang -arch arm64 -ffreestan
Do not emit a named symbol to denote the start of the debug_frame section
When emitting a debug_frame section, it contains a named symbol.
> echo "void foo(void) {}" | clang -arch arm64 -ffreestanding -g -c -o \ /tmp/test.o -x c - > nm /tmp/test.o -s __DWARF __debug_frame 0000000000000200 s ltmp1
There are no such symbols emitted in any of the other DWARF sections, this is because when the __debug_frame section is created, it doesn't get a `BeginSymName` and so it creates a named symbol, such as `ltmp1` and emits it when we switch to the section in MCDwarf.cpp.
This patch fixes the above issue.
Differential Revision: https://reviews.llvm.org/D153484
show more ...
|
#
62d86142 |
| 17-Jun-2023 |
Fangrui Song <i@maskray.me> |
[Pseudo Probe] Make .pseudo_probe GC-able
* Add the SHF_LINK_ORDER flag so that the .pseudo_probe section is discarded when the associated text section is discarded. * Add unique ID so that with `cl
[Pseudo Probe] Make .pseudo_probe GC-able
* Add the SHF_LINK_ORDER flag so that the .pseudo_probe section is discarded when the associated text section is discarded. * Add unique ID so that with `clang -ffunction-sections -fno-unique-section-names`, there is one separate .pseudo_probe for each text section (disambiguated by `.section ....,unique,id` in assembly)
The changes allow .pseudo_probe GC even if we don't place instrumented functions in an IR comdat (see `getOrCreateFunctionComdat` in SampleProfileProbe.cpp).
Reviewed By: hoy
Differential Revision: https://reviews.llvm.org/D153189
show more ...
|
Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2 |
|
#
62c7f035 |
| 07-Feb-2023 |
Archibald Elliott <archibald.elliott@arm.com> |
[NFC][TargetParser] Remove llvm/ADT/Triple.h
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
|
Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7 |
|
#
60172097 |
| 26-Dec-2022 |
Andrei Safronov <andrei.safronov@espressif.com> |
[Xtensa 5/10] Add Xtensa MCTargetDescr initial functionality
Differential Revision: https://reviews.llvm.org/D64831
|