[LLVM][DAGCombiner] Look through freeze when combining extensions of loads (#175022)
Following on from https://github.com/llvm/llvm-project/pull/172484 I
have added support to tryToFoldExtOfLoad for looking through freezes, in
order to catch more cases of extending loads. This type of code is
sometimes seen being generated by the loop vectoriser. For now I've
limited this to cases where the load is only used by the freeze, since
otherwise it leads to worse code in some X86 tests.
[lldb] Refactor command option printing (#178208)
So I have an easier time fixing #177570.
Changes I have made:
* Init a variable inside if statement to reduce scope.
* Added const to some variables.
* Early return if we print a single line, and dedent the "else" that
handles multiple lines.
* Only convert lldb's short codes into ansi codes once.
* Rename a couple of variables where they could have either referred to
the visible text or the raw data with the ansi codes in.
[AArch64][llvm] Gate some `tlbip` insns with +tlbid or +d128
Change the gating of `tlbip` instructions containing `*E1IS*`, `*E1OS*`,
`*E2IS*` or `*E2OS*` to be used with `+tlbid` or `+d128`. This is because
the 2025 Armv9.7-A MemSys specification says:
```
All TLBIP *E1IS*, TLBIP*E1OS*, TLBIP*E2IS* and TLBIP*E2OS* instructions
that are currently dependent on FEAT_D128 are updated to be dependent
on FEAT_D128 or FEAT_TLBID
```
[lldb] Fix UbSan decorator (#177964)
the ubsan decorator previously assumes the platform is macOS.
macOS has an extra underscore in symbols names match two or more.
uses the llvm-nm that is built instead of the system's nm.
[MLIR][OpenMP] Simplify OpenMP device codegen
After removing host operations from the device MLIR module, it is no longer
necessary to provide special codegen logic to prevent these operations from
causing compiler crashes or miscompilations.
This patch removes these now unnecessary code paths to simplify codegen logic.
Some MLIR tests are now replaced with Flang tests, since the responsibility of
dealing with host operations has been moved earlier in the compilation flow.
MLIR tests holding target device modules are updated to no longer include now
unsupported host operations.
[Flang][OpenMP] Minimize host ops remaining in device compilation
This patch updates the function filtering OpenMP pass intended to remove host
functions from the MLIR module created by Flang lowering when targeting an
OpenMP target device.
Host functions holding target regions must be kept, so that the target regions
within them can be translated for the device. The issue is that non-target
operations inside these functions cannot be discarded because some of them hold
information that is also relevant during target device codegen. Specifically,
mapping information resides outside of `omp.target` regions.
This patch updates the previous behavior where all host operations were
preserved to then ignore all of those that are not actually needed by target
device codegen. This, in practice, means only keeping target regions and mapping
information needed by the device. Arguments for some of these remaining
operations are replaced by placeholder allocations and `fir.undefined`, since
they are only actually defined inside of the target regions themselves.
[3 lines not shown]
[mlir] Fix integer overflow in ShapedType::getNumElements and `makeCanonicalStridedLayoutExpr` (#178395)
Add to `ShapedTypeInterface` a new `tryGetNumElements()` API which
returns `std::optional<int64_t>` - returns `std::nullopt` on overflow
instead of UB, using `llvm::checkedMul` for proper overflow detection.
`getNumElements()` now uses this new API to assert on overflow.
Also fix `AffineExpr` canonicalization to avoid crashing on overflow
using `llvm::checkedMul`.
Fixes #178362
Fixes #177816
---------
Co-authored-by: Claude Opus 4.5 <noreply at anthropic.com>
[AArch64][Driver] Enable host supported features with march=native. (#177128)
Currently, march=native enables the base features implied by the host
system architecture, such as Armv8.2-A, Armv9-A, etc, rather than the
actual features supported by the host (e.g. crypto). This is suboptimal
as it generally leaves optional but supported features disabled.
This patch aligns the behaviour of march=native with mcpu=native by
using the latter's decoding logic to decode the former as well. This
means both options should enable a similar set of features. We also set
the target-cpu accordingly, so that march=native becomes a drop-in
replacement for mcpu=native.
[lldb][test] Add tests for formatting of command option descriptions (#178235)
These test the existing behaviour before I work on #177570.
I chose "breakpoint set" because it has options with ANSI underlines
in the description.
The tests cover no ANSI (use-colour off) and with ANSI (use-color on).
The latter is where we have problems right now.
[lldb] Fix memory monitor shutdown on Linux using eventfd (#178083)
The current linux implementation has a 1 second timeout when polling for
memory pressure. lldb-dap may take up to an extra 1 second to shutdown.
Use an event file descriptor to immediately stop the memory monitor
thread.
Fixes #150220
[AMDGPU] Change scale_src2 encoding from vgpr0 to literal 0 (#178404)
This changes the fix from #167777 to use the encoding for literal 0
instead of the encoding for vgpr0, to match new SP3 behaviour and for
consistency with all other unused VALU source operands since #175753.
[libc++][NFC] Remove _LIBCPP_FREESTANDING (#176907)
`_LIBCPP_FREESTANDING` isn't used and it is unclear what libc++'s
strategy is going to be for implementing freestanding at the moment.
Therefore, remove the macro.
[AMDGPU][GFX1250] Implement offset handling in s.buffer.load (#178389)
Divergent path of s.buffer.load must handle 32b offset extension
behaviour on GFX1250.
Tests in llvm.amdgcn.s.buffer.load.ll are rewritten to avoid using
export instructions not available on GFX1250.
[WebAssembly] Fix crash in ReplaceNodeResults for ANY_EXTEND_VECTOR_INREG (#178374)
Fixes a crash during type legalization by allowing
ISD::ANY_EXTEND_VECTOR_INREG to fall back to default expansion instead
of hitting llvm_unreachable.
Fixed: #177209
(cherry picked from commit 16d8d4b84edd257a81b243767d7b6bd62bbfb9fa)
[LifetimeSafety] Handle temporaries of non-trivial view types (#177878)
Fixes https://github.com/llvm/llvm-project/issues/177802
This enables the analysis to correctly track lifetimes through
non-trivial view types that require temporary binding due to having a
destructor.
This is fixed by handling `MaterializeTemporaryExpr` even for
lifetime-extended temporaries and fixing the flow of origins.