Reland "[4/7][PISA] Add PISA GlobalISel lowering, legalization and combiners #214373" with a fix (#249488)
Relands https://github.com/llvm/llvm-project/pull/214373 with a fix. The
PR was reverted due to a build issue.
The fix is in a separate commit below:
- PISATargetParser.h now directly includes llvm/ADT/STLExtras.h for
llvm::find_if.
- PISATargetParser.cpp now includes the private BasicSubtarget.h.
emulators/mutsu: [NEW PORT] Fujitsu FM-7 and FM77AV emulator
Mutsu is an emulator of the Fujitsu FM-7 series of Japanese home
computers, focused on the FM77AV. It aims to reproduce the hardware
closely enough to run original disks, including copy-protected ones,
as they are. It is written by Soji Yamakawa (CaptainYS), the author
of the Tsugaru FM Towns emulator, and shares code with it.
It needs ROM images dumped from real hardware, in the file names used
by the XM7 emulator.
WWW: https://github.com/captainys/77AVEMU
PR: 301057
misc/tvm: Install libtvm_ffi.so and its headers
PR: 301580
libtvm_runtime.so, libtvm_runtime_extra.so and libtvm_compiler.so are
linked against libtvm_ffi.so, but the package does not include it, so
none of them can be loaded. The bundled tvm-ffi skips its install
rules when it is built as part of another project. Install the
library, and the tvm/ffi headers that the installed tvm headers
include.
The installed headers also include dlpack/dlpack.h, so add misc/dlpack
to RUN_DEPENDS.
misc/py-tvm: Update 0.19.0 → 0.27.0
PR: 301580
- Build only the Python package, as before, and load the libraries
from misc/tvm: ${LOCALBASE}/lib and ${LOCALBASE}/include are added to
the search paths.
- Add misc/py-apache-tvm-ffi, ml-dtypes and typing-extensions; drop
attrs, decorator and synr, which 0.27 no longer uses.
- The llvm RUN_DEPENDS used "=" and dropped the Python dependencies;
use "+=".
- The wheel is named apache_tvm, so install it with an own do-install
and keep generating the plist in post-install. pkg-plist (still
0.15.0) is unused and can be deleted.
- Remove python/tvm/ir/type_relation.py, which can't be imported
(removed upstream in c89ebf33e2).
Changes: https://github.com/apache/tvm/releases/tag/v0.27.0
[lldb][NetBSD] Fix build (#249322)
FileSpec::GetFilename() now returns a StringRef, and the Status
constructor taking an llvm::Error is protected. Also drop a std::move()
that -Wpessimizing-move warns about.
Assisted-by: Claude Opus 5.5
[StructurizeCFG] Move zero-cost Else optimization to a follow-up pass (#244111)
Remove zero-cost Else hoisting and merge-input replacement from
StructurizeCFG. Else value is retained in the merge block's PHIs,
avoiding incorrectly replacing it with flow value. The hoisting Else
optimization is moved to StructurizeCFGOpt pass, which runs immediately
after for optimized AMDGPU pipelines.
Match a Flow -> Else -> Merge triangle and follow corresponding value
and branch-condition PHIs to establish that the Flow value equals the
Else value whenever Else branch is taken. Check hoistability of Else
Def, refining poison inputs, and removing the redundant merge PHI.
Reject unfamiliar inputs, cyclic PHI dependencies, and unsafe backedge
availability before mutation.
Require the hoist to strictly dominate every matched PHI block: a nested
backedge PHI can otherwise carry the previous iteration's Else value
even without a cyclic PHI dependency. The new nested_backedge regression
reproduces a defined wrong result with the earlier, leaf-only guard.
[27 lines not shown]
[lldb][NetBSD] Set the process group and session IDs (#249330)
Fill in the process group and session IDs from kinfo_proc2, as FreeBSD
and OpenBSD do. This fixes HostTest.GetProcessInfo on NetBSD.
Assisted-by: Claude Opus 5.5
[lldb][NetBSD] Set the current thread when a thread stops (#249325)
lldb-server builds its stop reply from the current thread, but on NetBSD
that was only ever set to the first thread. A signal, breakpoint, single
step or watchpoint hit in another thread was reported as a stop with no
reason on the first thread. Set the current thread to the thread that
stopped, as FreeBSD does.
Assisted-by: Claude Opus 5.5
[ConstantFolding] Do not fold ptrtoint of a GEP on a cast of null
`ConstantFoldCastOperand` folds `ptrtoint (gep null, x)` to `x`. It finds the
GEP base with `stripAndAccumulateConstantOffsets`, which also looks through
`addrspacecast`, so the fold assumes that a cast of null to another address
space is null too (with the current meaning of null, both are zero). But
`addrspacecast (ptr null to ptr addrspace(N))` is not necessarily `ptr
addrspace(N) null`: on AMDGPU, `addrspacecast (ptr null to ptr addrspace(3))` is
the LDS null pointer, 0xFFFFFFFF, so `ptrtoint (gep (addrspacecast null), x)` is
`x - 1`, not `x`. This PR only folds when the null base is in the address space
of the GEP. The fold still assumes that null is the zero address, which holds
for all in-tree data layouts.
This PR was assisted by AI but I reviewed all the changes.
[NFC][InstSimplify] Add a test for ptrtoint of a GEP on a cast of null
`ConstantFoldCastOperand` folds `ptrtoint (gep (addrspacecast null), x)` to `x`,
although the value of a cast of null depends on the target.
[SLP]Preserve poison mask in revec shufflevector
Combining a revec shufflevector with a shuffle operand indexed the
source mask with PoisonMaskElem (-1), asserting out of bounds.
Pull-request: https://github.com/llvm/llvm-project/pull/249494