390 Commits

Author SHA1 Message Date
Anshul Nigham
97d50c1490
[NewPM] Adds a port for AArch64PreLegalizerCombiner (#190567)
Standard porting (note that TargetPassConfig dependency was [removed
earlier](e27e7e4339)).

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2026-04-06 14:01:37 -07:00
Anshul Nigham
2fc712d8d9
[NewPM] Adds a port for AArch64O0PreLegalizerCombiner (#189776)
Adds a standard porting for AArch64O0PreLegalizerCombiner.

Note:

- Moves the AArch64GenO0PreLegalizeGICombiner.inc import outside of
anonymous namespace to use it as a member in the NewPM class (which
needs to be declared in AArch64.h)
- Test update needed a requires directive for the libcall-lowering-info
dependency

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2026-04-02 10:29:29 -07:00
Anshul Nigham
dee982d6c8
[NewPM] Adds a port for AArch64PostCoalescerPass (#189520)
Adds a standard porting for AArch64PostCoalescer to NewPM.
2026-04-01 19:18:18 -07:00
Henry Jiang
bf50489eeb
[Psuedoprobe][MachO] Enable pseudo probes emission for MachO (#185758)
Enable pseudo probes emission for MachO. Due to the 16 character limit
of MachO segment and section, the file sections will be
`__PSEUDO_PROBE,__probes` and `__PSEUDO_PROBE,__probe_descs`.
2026-03-31 16:27:58 -07:00
Anshul Nigham
60c911a6f7
[NewPM] Adds a port for AArch64PointerAuth (#188352)
Adds a standard NewPM port for AArch64PointerAuth.

No test updates since all `.mir` files referencing this pass run
combinations of passes, not all of which are ported.
2026-03-25 09:13:37 -07:00
Anshul Nigham
063109f758
[NewPM] Adds a port for AArch64MIPeepholeOpt (#187515)
Adds a port for AArch64MIPeepholeOpt

- Refactored lib/Target/AArch64/AArch64MIPeepholeOpt.cpp to extract base
logic as Impl
- Renamed existing pass with "Legacy" suffix and updated references
- Added NewPM pass AArch64MIPeepholeOptPass
- Updated tests
2026-03-20 09:17:34 -07:00
Anshul Nigham
a67c3b7468
[NewPM] Adds a port for AArch64ExpandPseudo (#187332)
Adds a port for AArch64ExpandPseudo to NewPM.

- Refactored lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp to extract
base logic as Impl
- Renamed existing pass with "Legacy" suffix and updated references
- Added NewPM pass AArch64ExpandPseudoPass
- Updated tests

Following tests mention this pass but weren't migrated because they need
a full codegen pipeline which doesn't exist yet.

```
  LLVM :: CodeGen/AArch64/GlobalISel/arm64-pcsections.ll
  LLVM :: CodeGen/AArch64/addg_subg.mir
  LLVM :: CodeGen/AArch64/rvmarker-pseudo-expansion-and-outlining.mir
  LLVM :: CodeGen/AArch64/spillfill-sve.mir
  LLVM :: CodeGen/AArch64/subreg_to_reg_coalescing_issue.mir
```
2026-03-18 15:22:10 -07:00
Anshul Nigham
fa8d3c810f
[NewPM] Add port for AArch64DeadRegisterDefinitionsPass (#187180)
Adds a newPM pass for AArch64DeadRegisterDefinitions

* Refactors base logic into an Impl class
* Renames old pass with the "Legacy" suffix
* Adds the new pass manager pass using refactored logic

No existing `.mir` tests to update.

Context and motivation in
https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers
2026-03-18 06:56:10 -07:00
Anshul Nigham
832c95948c
[NewPM] Port for AArch64ConditionOptimizer (#186941)
Adds a newPM pass for AArch64ConditionOptimizer.

- Refactors base logic into an Impl class
- Renames old pass with the "Legacy" suffix
- Adds the new pass manager pass using refactored logic
- Updates tests

Context and motivation in
https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers
2026-03-17 16:50:37 +00:00
Gergo Stomfai
e8a03bb043
[CodGen] Port UnpackMachineBundles to new pass manager (#184918) 2026-03-17 09:01:37 -07:00
Anshul Nigham
93442364fa
[NewPM] Port for AArch64CompressJumpTables (#186020) 2026-03-12 14:01:42 -07:00
Anshul Nigham
7f34bd2cf4
[NewPM] Port AArch64CollectLOHPass (#185789) 2026-03-11 12:20:50 -07:00
Anshul Nigham
7615f587e5
[NewPM] Port AArch64BranchTargets (#185585) 2026-03-10 20:49:16 +00:00
Anshul Nigham
dff05ac06f
[NewPM] Add port for aarch64-simd-scalar (#185256) 2026-03-10 08:12:33 -07:00
Anshul Nigham
e435e07496
[NewPM] Port for AArch64A53Fix835769 (#184965) 2026-03-07 00:39:19 +00:00
Jonathan Thackray
43f78384e9
[AArch64] Fix more typos (NFC)
Fix more typos in the AArch64 codebase using the
https://github.com/crate-ci/typos Rust package.

commit-id:9f4d826d

Reviewers: davemgreen

Pull Request: https://github.com/llvm/llvm-project/pull/183086
2026-03-06 22:26:42 +00:00
David Green
779d76c9ef
[AArch64] Add basic NPM support for LoadStoreOptimizer. (#184090)
This adds what I can tell is the the basics for NPM support on LLVM, and
ports the AArch64LoadStoreOpt pass to have NPM support.
2026-03-03 16:46:45 +00:00
Cullen Rhodes
53648f571a
[AArch64] -aarch64-enable-global-isel-at-O=-1 should disable GISel (#182250)
Recent changes in #174746 to use GISel for optnone functions broke this.
Now at O3 -aarch64-enable-global-isel-at-O=-1 is having the opposite
affect of actually enabling GISel instead of SDAG and at O0 FastISel is
no longer used. I've added a check for if this is disabled.
2026-02-23 08:40:08 +00:00
Ryan Cowan
ad1a45b903
[AArch64] Use GISel for optnone functions (#174746)
Currently, when SDAG is run on AArch64 and an `optnone` function is
encountered, the selector is chosen as FastISel. AArch64 makes use of
GlobalISel at O0 and this patch aims to align `optnone` with this
functionality.

A flag is exposed to enable this functionality for a given backend but,
as AArch64 is currently the only backend I could find using GlobalISel
at O0 this is the only one with it implemented. This flag is set when
the target supports GlobalISel & GlobalISel hasn't been forced by the
user, the target machine or by being at an optimisation level lower than
`EnableGlobalISelAtO`.

If this happens, the GlobalISel passes are included as shown in
`llvm/test/CodeGen/AArch64/O3-pipeline.ll` and skipped by IRTranslator
for functions not marked as `optnone`.

In updating the tests based on this functionality, I found some unused
check lines or run lines that mixed SDAG with GlobalISel pass names
which have been fixed.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2026-01-29 16:30:22 +00:00
Sander de Smalen
91f5d73b31
[AArch64] Add new pass after VirtRegRewriter to add implicit-defs (#174188)
When SubRegister Liveness Tracking (SRLT) is enabled, this pass adds
extra implicit-def's to instructions that define the low N bits of a
GPR/FPR register to represent that the top bits are written, because all
AArch64 instructions that write the low bits of a GPR/FPR also
implicitly zero the top bits.

These semantics are originally represented in the MIR using
`SUBREG_TO_REG`, but during register coalescing this information is lost
and when rewriting virtual -> physical registers the implicit-defs are
not added to represent the the top bits are written.

There have been several attempts to fix this in the coalescer (#168353),
but each iteration has exposed new bugs and the patch had to be
reverted. Additionally, the concept of adding 'implicit-def' of a
virtual register during the register allocation process is particularly
fragile and many places don't expect it (for example in
`X86::commuteInstructionImpl` the code only looks at specific operands
and does not consider implicit-defs. Similar in
`SplitEditor::addDeadDef` where it traverses operand 'defs' rather than
'all_defs').

We want a temporary solution that doesn't impact other targets and is
simpler and less intrusive than the patch proposed for the register
coalescer so that we can enable SRLT to make better use of SVE/SME
multi-vector instructions while we work on a more permanent solution
that requires rewriting a large part of the AArch64 instructions (32-bit
and NEON).
2026-01-14 16:42:15 +00:00
Benjamin Maxwell
db075a8ff7
[AArch64] Enable the new SME ABI lowering (-aarch64-new-sme-abi) by default (#172642)
The previous SelectionDAG lowering is still available via
`-aarch64-new-sme-abi=false` (this will stay around until at least LLVM
23).

In tests that contained `CHECK-NEWLOWERING` the checks have been updated
so:

* `CHECK-NEWLOWERING` -> `CHECK` (the new default)
* `CHECK` -> `CHECK-SDAG` (the old SelectionDAG lowering)

But otherwise, the check lines have not changed.

Tests that were not explicitly checking the SME lowering have been
updated to match the new default lowering.

Those tests are:

* llvm/test/CodeGen/AArch64/O0-pipeline.ll
* llvm/test/CodeGen/AArch64/O3-pipeline.ll
* llvm/test/CodeGen/AArch64/sme-disable-gisel-fisel.ll
* llvm/test/CodeGen/AArch64/sme-framelower-use-bp.ll
* llvm/test/CodeGen/AArch64/stack-hazard.ll
2025-12-19 10:19:02 +00:00
David Green
26f5116266
[AArch64] Optimize CBZ wzr and friends. (#161508)
In certain situations, especially with zero phi operands propagated after tail
duplications, we can end up with CBZ/CBNZ/TBZ/TBNZ with a zero register. It
can can be introduced late in the pipeline.

This patch adds a basic pass to fold them away to either a direct branch or
removing the instruction entirely. It runs quite late n the pipeline, so doesnt
fit into any of the existing passes. It only needs to look at the terminators
to each BB, so the new pass should have a limited in compile-time impact.
2025-12-05 17:44:45 +00:00
Eric Christopher
95c93f40ac
Cleanups in AArch64 (#168025)
Forward declare a couple of classes for simplicity, remove some unused
headers, clean up a comment.

Tested with check-all.
2025-11-15 11:55:39 -08:00
serge-sans-paille
28d9f99a27
Remove unused standard headers: <string>, <optional>, <numeric>, <tuple> (#167232) 2025-11-10 12:17:12 +00:00
Benjamin Maxwell
57d4c90dac
[AArch64][SME] Propagate desired ZA states in the MachineSMEABIPass (#149510)
This patch adds a step to the MachineSMEABIPass that propagates desired
ZA states.

This aims to pick better ZA states for edge bundles, as when many (or
all) blocks in a bundle do not have a preferred ZA state, the ZA state
assigned to a bundle can be less than ideal.

An important case is nested loops, where only the inner loop has a
preferred ZA state. Here we'd like to propagate the ZA state from the
inner loop to the outer loops (to avoid saves/restores in any loop).
2025-10-28 09:41:57 +00:00
David Green
a50c11a715
[AArch64] Enable GlobalMerge on externals (#158592)
GlobalMerge has been enabled for minsize for a while, this patch enables
it more generally. In my testing it did not affect performance very
much, especially with the linker relaxations we already perform, but
should help reduce code size a little.
2025-09-17 17:49:23 +01:00
Reid Kleckner
f3efbce4a7
[llvm] Move data layout string computation to TargetParser (#157612)
Clang and other frontends generally need the LLVM data layout string in
order to generate LLVM IR modules for LLVM. MLIR clients often need it
as well, since MLIR users often lower to LLVM IR.

Before this change, the LLVM datalayout string was computed in the
LLVM${TGT}CodeGen library in the relevant TargetMachine subclass.
However, none of the logic for computing the data layout string requires
any details of code generation. Clients who want to avoid duplicating
this information were forced to link in LLVMCodeGen and all registered
targets, leading to bloated binaries. This happened in PR #145899,
which measurably increased binary size for some of our users.

By moving this information to the TargetParser library, we
can delete the duplicate datalayout strings in Clang, and retain the
ability to generate IR for unregistered targets.

This is intended to be a very mechanical LLVM-only change, but there is
an immediately obvious follow-up to clang, which will be prepared
separately.

The vast majority of data layouts are computable with two inputs: the
triple and the "ABI name". There is only one exception, NVPTX, which has
a cl::opt to enable short device pointers. I invented a "shortptr" ABI
name to pass this option through the target independent interface.
Everything else fits. Mips is a bit awkward because it uses a special
MipsABIInfo abstraction, which includes members with codegen-like
concepts like ABI physical registers that can't live in TargetParser. I
think the string logic of looking for "n32" "n64" etc is reasonable to
duplicate. We have plenty of other minor duplication to preserve
layering.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Co-authored-by: Sergei Barannikov <barannikov88@gmail.com>
2025-09-11 11:05:29 -07:00
Fangrui Song
0d28b92506
[AArch64] Don't run loop-idiom-vectorize pass in the O0 pipeline (#156802)
As noted in #156787
2025-09-06 00:12:36 -07:00
Benjamin Maxwell
eb764040bc
[AArch64][SME] Implement the SME ABI (ZA state management) in Machine IR (#149062)
## Short Summary

This patch adds a new pass `aarch64-machine-sme-abi` to handle the ABI
for ZA state (e.g., lazy saves and agnostic ZA functions). This is
currently not enabled by default (but aims to be by LLVM 22). The goal
is for this new pass to more optimally place ZA saves/restores and to
work with exception handling.

## Long Description

This patch reimplements management of ZA state for functions with
private and shared ZA state. Agnostic ZA functions will be handled in a
later patch. For now, this is under the flag `-aarch64-new-sme-abi`,
however, we intend for this to replace the current SelectionDAG
implementation once complete.

The approach taken here is to mark instructions as needing ZA to be in a
specific ("ACTIVE" or "LOCAL_SAVED"). Machine instructions implicitly
defining or using ZA registers (such as $zt0 or $zab0) require the
"ACTIVE" state. Function calls may need the "LOCAL_SAVED" or "ACTIVE"
state depending on the callee (having shared or private ZA).

We already add ZA register uses/definitions to machine instructions, so
no extra work is needed to mark these.

Calls need to be marked by glueing Arch64ISD::INOUT_ZA_USE or
Arch64ISD::REQUIRES_ZA_SAVE to the CALLSEQ_START.

These markers are then used by the MachineSMEABIPass to find
instructions where there is a transition between required ZA states.
These are the points we need to insert code to set up or restore a ZA
save (or initialize ZA).

To handle control flow between blocks (which may have different ZA state
requirements), we bundle the incoming and outgoing edges of blocks.
Bundles are formed by assigning each block an incoming and outgoing
bundle (initially, all blocks have their own two bundles). Bundles are
then combined by joining the outgoing bundle of a block with the
incoming bundle of all successors.

These bundles are then assigned a ZA state based on the blocks that
participate in the bundle. Blocks whose incoming edges are in a bundle
"vote" for a ZA state that matches the state required at the first
instruction in the block, and likewise, blocks whose outgoing edges are
in a bundle vote for the ZA state that matches the last instruction in
the block. The ZA state with the most votes is used, which aims to
minimize the number of state transitions.
2025-08-19 10:00:28 +01:00
Ellis Hoag
0d1392e979
[MachineOutliner] Remove LOHs from outlined candidates (#143617)
Remove Linker Optimization Hints (LOHs) from outlining candidates
instead of simply preventing outlining if LOH labels are found in the
candidate. This will improve the effectiveness of the machine outliner
when LOHs are enabled (which is the default).

In
https://discourse.llvm.org/t/loh-conflicting-with-machineoutliner/83279/1
it was observed that the machine outliner is much more effective when
LOHs are disabled. Rather than completely disabling LOH, this PR aims to
keep LOH in most places and removing them from outlined functions where
it could be illegal. Note that we are conservatively removing all LOHs
from outlined functions for simplicity, but I believe we could retain
LOHs that are in the intersection of all candidates.

It should be ok to remove these LOHs since these blocks are being
outlined anyway, which will harm performance much more than the gain
from keeping the LOHs.
2025-06-30 14:29:06 -07:00
Benjamin Maxwell
f37d944152
[AArch64][SME] Use reportFatalUsageError rather than assert (NFC) (#145491)
Fixes #144351
2025-06-25 00:08:36 +01:00
Andrew Rogers
19658d1474
[llvm] annotate interfaces in llvm/Target for DLL export (#143615)
## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public
interface for export. This patch annotates the `llvm/Target` library.
These annotations currently have no meaningful impact on the LLVM build;
however, they are a prerequisite to support an LLVM Windows DLL (shared
library) build.

## Background

This effort is tracked in #109483. Additional context is provided in
[this
discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307),
and documentation for `LLVM_ABI` and related annotations is found in the
LLVM repo
[here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst).

A sub-set of these changes were generated automatically using the
[Interface Definition Scanner (IDS)](https://github.com/compnerd/ids)
tool, followed formatting with `git clang-format`.

The bulk of this change is manual additions of `LLVM_ABI` to
`LLVMInitializeX` functions defined in .cpp files under llvm/lib/Target.
Adding `LLVM_ABI` to the function implementation is required here
because they do not `#include "llvm/Support/TargetSelect.h"`, which
contains the declarations for this functions and was already updated
with `LLVM_ABI` in a previous patch. I considered patching these files
with `#include "llvm/Support/TargetSelect.h"` instead, but since
TargetSelect.h is a large file with a bunch of preprocessor x-macro
stuff in it I was concerned it would unnecessarily impact compile times.

In addition, a number of unit tests under llvm/unittests/Target required
additional dependencies to make them build correctly against the LLVM
DLL on Windows using MSVC.

## Validation

Local builds and tests to validate cross-platform compatibility. This
included llvm, clang, and lldb on the following configurations:

- Windows with MSVC
- Windows with Clang
- Linux with GCC
- Linux with Clang
- Darwin with Clang
2025-06-17 13:28:45 -07:00
Pengcheng Wang
f393986b53
[MISched] Add templates for creating custom schedulers (#141935)
We rename `createGenericSchedLive` and `createGenericSchedPostRA`
to `createSchedLive` and `createSchedPostRA`, and add a template
parameter `Strategy` which is the generic implementation by default.

This can simplify some code for targets that have custom scheduler
strategy.
2025-06-03 11:37:40 +08:00
Matthias Braun
675cb70641
Register assembly printer passes (#138348)
Register assembly printer passes in the pass registry.

This makes it possible to use `llc -start-before=<target>-asm-printer ...` in tests.

Adds a `char &ID` parameter to the AssemblyPrinter constructor to allow
targets to use the `INITIALIZE_PASS` macros and register the pass in the
pass registry. This currently has a default parameter so it won't break
any targets that have not been updated.
2025-05-06 18:01:17 -07:00
Sergei Barannikov
bb1765179e
[TTI] Simplify implementation (NFCI) (#136674)
Replace "concept based polymorphism" with simpler PImpl idiom.

This pursues two goals:
* Enforce static type checking. Previously, target implementations hid
base class methods and type checking was impossible. Now that they
override the methods, the compiler will complain on mismatched
signatures.
* Make the code easier to navigate. Previously, if you asked your
favorite LSP server to show a method (e.g. `getInstructionCost()`), it
would show you methods from `TTI`, `TTI::Concept`, `TTI::Model`,
`TTIImplBase`, and target overrides. Now it is two less :)

There are three commits to hopefully simplify the review.

The first commit removes `TTI::Model`. This is done by deriving
`TargetTransformInfoImplBase` from `TTI::Concept`. This is possible
because they implement the same set of interfaces with identical
signatures.

The first commit makes `TargetTransformImplBase` polymorphic, which
means all derived classes should `override` its methods. This is done in
second commit to make the first one smaller. It appeared infeasible to
extract this into a separate PR because the first commit landed
separately would result in tons of `-Woverloaded-virtual` warnings (and
break `-Werror` builds).

The third commit eliminates `TTI::Concept` by merging it with the only
derived class `TargetTransformImplBase`. This commit could be extracted
into a separate PR, but it touches the same lines in
`TargetTransformInfoImpl.h` (removes `override` added by the second
commit and adds `virtual`), so I thought it may make sense to land these
two commits together.

Pull Request: https://github.com/llvm/llvm-project/pull/136674
2025-04-26 15:25:40 +03:00
Rahul Joshi
23c27f3efc
[NFC][LLVM][AArch64] Cleanup pass initialization for AArch64 (#134315)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 10:24:27 -07:00
Shubham Sandeep Rastogi
cc86d7cb19
Initialize aarch64-cond-br-tuning pass (#132087)
The call to the initializeAArch64CondBrTuningPass function is missing in
the AArch64TargetMachine LLVMInitializeAArch64Target function.

This means that the pass is not in the pass registry and options such as
-run-pass=aarch64-cond-br-tuning and
-stop-after=aarch64-cond-br-tuning cannot be used. This patch fixes that
issue.
2025-03-20 14:48:53 -07:00
Daniel Paoliello
16e051f0b9
[win] NFC: Rename EHCatchret to EHCont to allow for EH Continuation targets that aren't catchret instructions (#129953)
This change splits out the renaming and comment updates from #129612 as a non-functional change.
2025-03-06 09:28:44 -08:00
Akshat Oke
e3ece07593
Revert "Reland "[AArch64][NPM] Chalk out the CodeGenPassBuilder for NPM (#128…" (#128819)
Reverts llvm/llvm-project#128662

Still a link error.
2025-02-26 10:54:39 +05:30
Akshat Oke
e927cf6653
Reland "[AArch64][NPM] Chalk out the CodeGenPassBuilder for NPM (#128… (#128662)
…471)"

Reland https://github.com/llvm/llvm-project/pull/128471

The Passes library was not linked in earlier.
2025-02-26 10:48:29 +05:30
Kazu Hirata
83ddb43cad Revert "[AArch64][NPM] Chalk out the CodeGenPassBuilder for NPM (#128471)"
This reverts commit d85685eb863641dce62a9f858ebcd6bab56c605b.

Multiple buildbot failures have been reported:
https://github.com/llvm/llvm-project/pull/128471
2025-02-24 22:34:52 -08:00
Akshat Oke
d85685eb86
[AArch64][NPM] Chalk out the CodeGenPassBuilder for NPM (#128471)
This allows for testing AArch64 passes with the new pass manager.
2025-02-25 11:33:57 +05:30
Christudasan Devadasan
a47c35a699
[CodeGen] Move MISched target hooks into TargetMachine (#125700)
The createSIMachineScheduler & createPostMachineScheduler
target hooks are currently placed in the PassConfig interface.
Moving it out to TargetMachine so that both legacy and
the new pass manager can effectively use them.
2025-02-05 11:41:37 +05:30
Florian Mayer
514580b438
[MTE] Apply alignment / size in AsmPrinter rather than IR (#111918)
This makes sure no optimizations are applied that assume the
bigger alignment or size, which could be incorrect if we link
together with non-instrumented code.
2024-12-17 00:47:02 -08:00
Akshat Oke
3f9d02aae8
[CodeGen][NewPM] Port PeepholeOptimizer to NPM (#116326)
With this, all machine SSA optimization passes are available in the new codegen pipeline.
2024-11-18 11:02:01 +05:30
Matin Raayai
bb3f5e1fed
Overhaul the TargetMachine and LLVMTargetMachine Classes (#111234)
Following discussions in #110443, and the following earlier discussions
in https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html,
https://reviews.llvm.org/D38482, https://reviews.llvm.org/D38489, this
PR attempts to overhaul the `TargetMachine` and `LLVMTargetMachine`
interface classes. More specifically:
1. Makes `TargetMachine` the only class implemented under
`TargetMachine.h` in the `Target` library.
2. `TargetMachine` contains target-specific interface functions that
relate to IR/CodeGen/MC constructs, whereas before (at least on paper)
it was supposed to have only IR/MC constructs. Any Target that doesn't
want to use the independent code generator simply does not implement
them, and returns either `false` or `nullptr`.
3. Renames `LLVMTargetMachine` to `CodeGenCommonTMImpl`. This renaming
aims to make the purpose of `LLVMTargetMachine` clearer. Its interface
was moved under the CodeGen library, to further emphasis its usage in
Targets that use CodeGen directly.
4. Makes `TargetMachine` the only interface used across LLVM and its
projects. With these changes, `CodeGenCommonTMImpl` is simply a set of
shared function implementations of `TargetMachine`, and CodeGen users
don't need to static cast to `LLVMTargetMachine` every time they need a
CodeGen-specific feature of the `TargetMachine`.
5. More importantly, does not change any requirements regarding library
linking.

cc @arsenm @aeubanks
2024-11-14 13:30:05 -08:00
Daniel Kiss
3f40ad7ba8
Add ifunc support for Windows on AArch64. (#111962)
On Windows there is no platform support for ifunc but we could lower
them to global function pointers.
This also enables FMV for Windows with Clang and Compiler-rt.

Depends on #111961
2024-11-14 14:45:15 +01:00
Kazu Hirata
a41922ad75
[AArch64] Remove unused includes (NFC) (#115685)
Identified with misc-include-cleaner.
2024-11-11 07:35:08 -08:00
weiwei chen
c8a7f14b27
[Backend] Add clearSubtargetMap API for TargetMachine. (#112383)
- [x] Add `clearSubtargetInfo` API to TargetMachine and each backend to
make it possible to release memory used in each backend's
`SubtargetInfo` map if needed. Keep this API as `protected` so that it
will be used with precautions.
2024-11-07 10:05:19 -05:00
Christudasan Devadasan
488d3924dd
[CodeGen][NewPM] Port EarlyIfConversion pass to NPM. (#108508) 2024-10-16 13:22:57 +05:30