CodeGen: Add getDefBlock helper (#216182)
A reasonable number of places check getVRegDef just to
return the parent block, so introduce a helper for it.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DAG: Gracefully diagnose missing FP conversion libcalls when softening (#215765)
Diagnose the missing libcall and return poison instead.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[mlir][ArmSME] Enable native ArmSME integration testing on Darwin (#215296)
`MLIR_RUN_ARM_SME_TESTS=ON` could not exercise ArmSME integration tests
on real Apple Silicon SME hardware:
1. `check_hwcap` only detects CPU features via Linux's
`getauxval()`/`hwcap.h`, so it always required an emulator on Darwin,
even with real SME hardware present.
2. With `+sve` enabled, LLVM lowers `vector.vscale` to a bare
`cntd`/`cntb`, illegal outside streaming mode. Apple Silicon doesn't
expose base (non-streaming) SVE at EL0, so this traps (see #204853).
3. Some functions computing `vector.vscale` directly had no (or an
incorrectly unprefixed) streaming attribute, which is required for legal
`vscale` codegen and is silently dropped during `func.func` to
`llvm.func` conversion unless `llvm.`-prefixed (see #190864).
4. 6 tests force a specific streaming vector length via
`setArmSVLBits`/`setArmVLBits`, which isn't possible on real hardware
(SVL is fixed per core).
[22 lines not shown]
[LoongArch] Add late branch optimization pass
The patch adds a late optimization pass that replaces conditional
branches that can be statically evaluated with an unconditinal branch.
This pass is inspired by RISC-V's RISCVLateBranchOpt pass.
[LoongArch] Fix selection of BRCOND with constant conditions (#216027)
LoongArch DAG instruction selection could fail to select
`LoongArchISD::BRCOND` when its condition was a constant integer. Add
patterns to lower constant zero and one conditions to `BEQZ` and `BNEZ`.
Co-authored-by: wanglei <wanglei at loongson.cn>
Fixes: https://github.com/llvm/llvm-project/issues/215935
[PassInstrumentation] Replace llvm::Any with a tagged IRUnitRef. (NFC) (#215341)
llvm::Any currently requires heap allocations on every construction,
which is quite expensive for the use in PassInstrumentation.
Replace llvm::Any with a hand-rolled IRUnitRef wrapper that uses
PointerIntPair on platforms with 64 bit (or larger) pointers or a pair
of Kind/pointer on other platforms.
Unfortunately I don't think alignas(8) would work for Function (or any
Value*), as it uses `HungOffOperandsAllocMarker`.
Follow-up to https://github.com/llvm/llvm-project/pull/215120.
It further improves compile-time:
* stage1-O3: -0.09%
* stage1-ReleaseThinLTO: -0.09%
* stage1-ReleaseLTO-g: -0.08%
[4 lines not shown]
[RISCV] Don't fold vector (fp_to_sint (ceil/floor/round/etc X)) if the inner op has multiple uses. (#216137)
If the inner operation needs to write FRM and the folded operation
does too, combining them may require another pair of FRM writes
unless we can get rid of the inner operation.
This may be expensive on CPUs without FRM renaming support.
Assisted-by: Claude
[DWARFLinker] Constrain a function's high_pc to its own symbol
Mach-O objects built with .subsections_via_symbols make every symbol an
independently placeable atom, and the linker packs atoms without
preserving the spacing they had in the object file.
I have an example where the compiler describes such a subprogram as
extending past its own atom. While it's debatable whether that's a good
idea, it's not invalid in the object file. However, once linked, it is
invalid.
We can make dsymutil resilient against this by looking at the size of
the symbol in the debug map and adjusting the end_pc. I'm doing so
conservatively so that only a collision is repaired. Already
overlapping/invalid ranges remain untouched.
rdar://184768778
[lldb] Search for a corefile's images before loading any of them
A userland or kernel corefile can list hundreds of images, and searching for
one can shell out to a symbol server or fetch over the network. Searching for
them one at a time is where loading such a corefile spends its time.
Add a batch form of SymbolLocator::Locate that runs the searches on the
debugger's thread pool, gated on target.parallel-module-load. Results come
back in the order the requests were given, since that order decides the
Target's module order. Only the results are ordered, and anything a search
reports to the user arrives in whatever order the searches finish in.
Only the plugin searches run concurrently, so a platform hook does not have to
be thread safe to take part, and reading a binary's UUID out of memory stays
on the calling thread.
Setting up a platform binary can replace the Target's platform and dynamic
loader, and now happens for every image before any of them is searched for, so
the platform a corefile asks for is the one all of its images are searched
[4 lines not shown]
[ORC] Drop SimpleExecutorMemoryManagerSymbolNames struct (#216231)
Remove the SimpleExecutorMemoryManagerSymbolNames struct and the
orc_rt_SimpleNativeMemoryMapSPSSymbols global. The sps::MemMgr*CIName
constants in GenericMemoryManagerProxySpecs.h are now the single source
of truth for the SimpleNativeMemoryMap controller-interface names, used
by both the controller-side proxies and the executor-side
SimpleExecutorMemoryManager bootstrap registration (as
OrcRTBootstrap.cpp already does for the memory-access wrappers).
No functional change: the name strings are identical to those previously
held in orc_rt_SimpleNativeMemoryMapSPSSymbols.