Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
3fa5b527 |
| 22-Dec-2024 |
Fangrui Song <i@maskray.me> |
[MC] Decrease direct access to getContents()
to make it easier to store fragment contents out-of-line. Loosely based on Alexis Engelke's prototype.
|
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 |
|
#
28646d0c |
| 20-Sep-2024 |
alx32 <103613512+alx32@users.noreply.github.com> |
[MC] Add .loc_label instruction (#99710)
As discussed in [the
RFC](https://discourse.llvm.org/t/rfc-extending-llvm-mc-loc-directive-with-labeling-support/79608)
we need a way to create labels in t
[MC] Add .loc_label instruction (#99710)
As discussed in [the
RFC](https://discourse.llvm.org/t/rfc-extending-llvm-mc-loc-directive-with-labeling-support/79608)
we need a way to create labels in the assembler-generated line section
in order to support the future addition of the
[DW_AT_LLVM_stmt_sequence](https://discourse.llvm.org/t/rfc-new-dwarf-attribute-for-symbolication-of-merged-functions/79434)
attribute.
We have a similar precedent for such behavior with the
[.cfi_label](https://github.com/llvm/llvm-project/pull/97922)
instruction - so we add the `.loc_label THE_LABEL_NAME` instruction
which:
- Terminates the current line sequence in the line section
- Creates a new label with the specified label name in the `.debug_line`
section
show more ...
|
Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
21149470 |
| 23-Jul-2024 |
Fangrui Song <i@maskray.me> |
MCObjectStreamer: Remove an unneeded getBackendPtr test
All of `MCAsmBackend`, `MCCodeEmitter`, and `MCObjectWriter` must be non-null.
|
#
219d80bc |
| 23-Jul-2024 |
Fangrui Song <i@maskray.me> |
MCAssembler: Move FileNames and CompilerVersion to MCObjectWriter
|
#
f15266e9 |
| 04-Jul-2024 |
Alexis Engelke <engelke@in.tum.de> |
[MC][ELF] Emit instructions directly into fragment (#94950)
Avoid needless copying of instructions and fixups and directly emit into
the fragment small vectors.
This (optionally, second commit)
[MC][ELF] Emit instructions directly into fragment (#94950)
Avoid needless copying of instructions and fixups and directly emit into
the fragment small vectors.
This (optionally, second commit) also removes the single use of the
MCCompactEncodedInstFragment to simplify code.
show more ...
|
#
db48f1a1 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove nullable getCurrentSectionOnly use from AsmParser
We will implement getCurrentSectionOnly with `CurFrag->getParent()`, which is non-null. Eliminate a nullable use.
|
#
fcffb2c0 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Replace one nullable getCurrentSectionOnly with CurFrag
We will implement getCurrentSectionOnly with `CurFrag->getParent()`, which is non-null. Eliminate a nullable use.
|
#
fadc7223 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] switchSectionNoPrint: update CurFrag
To ensure that CurFrag->Parent and SectionStack.back() are in sync.
|
#
eaf816f6 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove unneeded nullness check from getOrCreateDataFragment. NFC
`getCurrentFragment()` no longer returns null after 7423bf78eb53d81ce0c7b3a38e39a56341ca2a89.
|
#
e48c4011 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Cache current fragment in MCStreamer
This eliminates indirection through `getCurrentSectionOnly()->curFragList()->Tail`.
|
#
7423bf78 |
| 28-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Ensure subsections have a MCDataFragment
Similar to 21fac2d1d060b0f9b11a746718e58d4cd1ee97e5 for sections. This makes it feasible to cache the current fragment in MCStreamer.
|
#
aa3589f0 |
| 27-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC,X86] emitInstruction: remove virtual function calls due to Intel JCC Erratum
https://reviews.llvm.org/D70157 (for Intel Jump Conditional Code Erratum) introduced two virtual function calls in th
[MC,X86] emitInstruction: remove virtual function calls due to Intel JCC Erratum
https://reviews.llvm.org/D70157 (for Intel Jump Conditional Code Erratum) introduced two virtual function calls in the generic MCObjectStreamer::emitInstruction, which added some overhead.
This patch removes the virtual function overhead:
* Define `llvm::X86_MC::emitInstruction` that calls `emitInstruction{Begin,End}`. * Define {X86ELFStreamer,X86WinCOFFStreamer}::emitInstruction to call `llvm::X86_MC::emitInstruction`
Pull Request: https://github.com/llvm/llvm-project/pull/96835
show more ...
|
#
e7622ab4 |
| 23-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove unused MCObjectStreamer::CurSubsectionIdx. NFC
|
#
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 ...
|
#
05ba5c06 |
| 23-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] MCSectionSubPair: replace const MCExpr * with uint32_t
|
#
485d7eae |
| 22-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove remnant code related to pending labels
|
#
75006466 |
| 22-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove pending labels
This commit removes the complexity introduced by pending labels in https://reviews.llvm.org/D5915 by using a simpler approach. D5915 aimed to ensure padding placement befo
[MC] Remove pending labels
This commit removes the complexity introduced by pending labels in https://reviews.llvm.org/D5915 by using a simpler approach. D5915 aimed to ensure padding placement before `.Ltmp0` for the following code, but at the cost of expensive per-instruction `flushPendingLabels`.
``` // similar to llvm/test/MC/X86/AlignedBundling/labeloffset.s .bundle_lock align_to_end calll .L0$pb .bundle_unlock .L0$pb: popl %eax .Ltmp0: //// padding should be inserted before this label instead of after addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax ```
(D5915 was adjusted by https://reviews.llvm.org/D8072 and https://reviews.llvm.org/D71368)
This patch achieves the same goal by setting the offset of the empty MCDataFragment (`Prev`) in `layoutBundle`. This eliminates the need for pending labels and simplifies the code.
llvm/test/MC/MachO/pending-labels.s (D71368): relocation symbols are changed, but the result is still supported by linkers.
show more ...
|
#
4684d0c0 |
| 22-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] emitLabelAtPos: change parameter to MCDataFragment &. NFC
emitLabelAtPos is only called by ARMELFStreamer with MCDataFragment.
|
#
87424778 |
| 22-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove the Parent parameter from MCFragment ctor callers. NFC
|
Revision tags: llvmorg-18.1.8 |
|
#
b1932b84 |
| 14-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Aligned bundling: remove special handling for RelaxAll
When both aligned bundling and RelaxAll are enabled, bundle padding is directly written into fragments (https://reviews.llvm.org/D8072). (
[MC] Aligned bundling: remove special handling for RelaxAll
When both aligned bundling and RelaxAll are enabled, bundle padding is directly written into fragments (https://reviews.llvm.org/D8072). (The original motivation was memory usage, which has been achieved from different angles with recent assembler improvement).
The code presents challenges with the work to replace fragment representation (e.g. #94950 #95077). This patch removes the special handling. RelaxAll still works but the behavior seems slightly different as revealed by 2 changed tests. However, most `-mc-relax-all` tests are unchanged.
RelaxAll used to be the default for clang -O0. This mode has significant code size drawbacks and newer Clang doesn't use it (#90013).
---
flushPendingLabels: The FOffset parameter can be removed: pending labels will be assigned to the incoming fragment at offset 0.
Pull Request: https://github.com/llvm/llvm-project/pull/95188
show more ...
|
#
f808abf5 |
| 14-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Add MCFragment allocation helpers
`allocFragment` might be changed to a placement new when the allocation strategy changes.
`allocInitialFragment` is to deduplicate the following pattern ```
[MC] Add MCFragment allocation helpers
`allocFragment` might be changed to a placement new when the allocation strategy changes.
`allocInitialFragment` is to deduplicate the following pattern ``` auto *F = new MCDataFragment(); Result->addFragment(*F); F->setParent(Result); ```
Pull Request: https://github.com/llvm/llvm-project/pull/95197
show more ...
|
#
90a23d3a |
| 13-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Restore setOffset(0) in emitLabel
For bolt/test/runtime/X86/exceptions-pic.test, llvm-bolt seems to call emitLabel twice and the assert will fail. Work around it after 2cc4bc132cbcc76c5552cbc12
[MC] Restore setOffset(0) in emitLabel
For bolt/test/runtime/X86/exceptions-pic.test, llvm-bolt seems to call emitLabel twice and the assert will fail. Work around it after 2cc4bc132cbcc76c5552cbc128830943ea596b3e
show more ...
|
#
2cc4bc13 |
| 12-Jun-2024 |
Fangrui Song <i@maskray.me> |
MCFragment: Initialize Offset to 0
After 9d0754ada5dbbc0c009bcc2f7824488419cc5530 ("[MC] Relax fragments eagerly") removes the assert of Offset, it is no longer useful to initialize the member to -1
MCFragment: Initialize Offset to 0
After 9d0754ada5dbbc0c009bcc2f7824488419cc5530 ("[MC] Relax fragments eagerly") removes the assert of Offset, it is no longer useful to initialize the member to -1.
Now the symbol value estimate is more precise, which leads to slight behavior change to layout-interdependency.s.
show more ...
|
#
de19f7b6 |
| 11-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Replace fragment ilist with singly-linked lists
Fragments are allocated with `operator new` and stored in an ilist with Prev/Next/Parent pointers. A more efficient representation would be an ar
[MC] Replace fragment ilist with singly-linked lists
Fragments are allocated with `operator new` and stored in an ilist with Prev/Next/Parent pointers. A more efficient representation would be an array of fragments without the overhead of Prev/Next pointers.
As the first step, replace ilist with singly-linked lists.
* `getPrevNode` uses have been eliminated by previous changes. * The last use of the `Prev` pointer remains: for each subsection, there is an insertion point and the current insertion point is stored at `CurInsertionPoint`. * `HexagonAsmBackend::finishLayout` needs a backward iterator. Save all fragments within `Frags`. Hexagon programs are usually small, and the performance does not matter that much.
To eliminate `Prev`, change the subsection representation to singly-linked lists for subsections and a pointer to the active singly-linked list. The fragments from all subsections will be chained together at layout time.
Since fragment lists are disconnected before layout time, we can remove `MCFragment::SubsectionNumber` (https://reviews.llvm.org/D69411). The current implementation of `AttemptToFoldSymbolOffsetDifference` requires future improvement for robustness.
Pull Request: https://github.com/llvm/llvm-project/pull/95077
show more ...
|
#
cb63abca |
| 11-Jun-2024 |
Fangrui Song <i@maskray.me> |
[MC] Remove getFragmentList uses. NFC
|