[clang][bytecode] Allocate functions via Program allocator (#219994)
They have the same lifetime as `Program`, so use the allocator we're
already carrying around.
[X86] Fix ADOX miscompile by restricting COND_O optimization when EFLAGS are used (#220117)
This patch fixes a miscompile where the X86 DAGCombiner aggressively
folds an `ADD` node into an `ADOX` instruction even when the Zero Flag
(ZF) produced by the `ADD` is used by a subsequent branch (e.g., `je`).
[VE] Create TS1AM with getMemIntrinsicNode (#220151)
isa<AtomicSDNode> returns false on the built node: the lookup key and
SDNode::Profile disagree and the node never CSEs (see #219911).
CodeGen/VE/Scalar/atomic_swap.ll will break when we add an assert to
FoldingSet::insert that the `nodeProfile()` output matches `Token`.
Fix with getMemIntrinsicNode (`def ts1am` carries SDNPMemOperand).
httpd: reject shared TLS listeners with different client CA or CRL
Virtual hosts on the same address and port share one TLS context, and
only the first hosts client CA and CRL are used. A client certificate
accepted there reaches every host on the listener, including one meant
to be restricted to a different CA. Such a configuration is now rejected
instead of silently ignored.
Bug report and diff by Acts1631
OK kirill@ claudio@
[Clang][CodeGen][X86] Fix crash on __int128 bit-field access units (#216777)
Fixes #202205
The x86-64 SysV classifier skipped every unnamed bit-field as padding,
so an eightbyte holding nothing but a non-zero-width unnamed bit-field
stayed `NO_CLASS`. GCC treats that storage as INTEGER. The crash falls
out of this: a run of `__int128` bit-fields is lowered to a single
`i128` access unit spanning both eightbytes, but with only one of them
classified INTEGER the `i128` gets queried at offset 8 and hits
`assert(IROffset == 0)` in `GetINTEGERTypeAtOffset` — or `assert(Hi ==
Integer)` in the callers, depending on which eightbyte holds the named
field. It also silently diverges from GCC on ordinary shapes like
`struct { long : 64; long a; }`, which clang passed in one register
where GCC uses two.
The fix skips only zero-length bit-fields and classifies the rest like
named ones, matching GCC. Both eightbytes of an `__int128` bit-field run
then come out `INTEGER`, so the existing asserts hold unchanged. The
[9 lines not shown]
[flang][OpenMP] Fix use_device_addr handling for COMMON blocks in target data (#217105)
Related to #217112
Flang already handles `use_device_addr` for regular variables on `target
data`,
but named COMMON blocks had two gaps: combining a COMMON block in `map`
and
`use_device_addr` was incorrectly rejected, and whole-COMMON
`use_device_addr`
could leave references in the region bound to the host COMMON instead of
the
returned device address.
This fixes the COMMON-block semantic handling and lowering so the valid
`map`/`use_device_addr` combination is accepted and COMMON members use
the
correct target-data bindings.
[3 lines not shown]
emulators/flycast: Update to 2.7 and unbreak
Port changes:
- Switch to net/asio130 to unbreak the build. This also guarantees a
more stable update path for the flycast port, because newer versions
of net/asio are constantly deprecating and removing APIs.
- Unbreak on FreeBSD < 15 for newer DreamPicoPort submodule.
- Unbundle several dependencies. This is accompanied with an
EXTRACT_AFTER_ARGS block to exclude unbundled and unused deps, which
ensures that these aren't accidently referenced by the build process.
- Add LIBCDIO option, enabled by default. This enables CDROM support via
libcdio. It was already available in previous flycast versions but was
forgotten in the port.
- Prevent searching for git via CMAKE_DISABLE_FIND_PACKAGE_Git.
- Separate several blocks with newlines to improve readability.
- Remove obsolete patches.
Changelog:
https://github.com/flyinghead/flycast/releases/tag/v2.7
[3 lines not shown]
emulators/flycast: Update to 2.7 and unbreak
Port changes:
- Switch to net/asio130 to unbreak the build. This also guarantees a
more stable update path for the flycast port, because newer versions
of net/asio are constantly deprecating and removing APIs.
- Unbreak on FreeBSD < 15 for newer DreamPicoPort submodule.
- Unbundle several dependencies. This is accompanied with an
EXTRACT_AFTER_ARGS block to exclude unbundled and unused deps, which
ensures that these aren't accidently referenced by the build process.
- Add LIBCDIO option, enabled by default. This enables CDROM support via
libcdio. It was already available in previous flycast versions but was
forgotten in the port.
- Prevent searching for git via CMAKE_DISABLE_FIND_PACKAGE_Git.
- Separate several blocks with newlines to improve readability.
- Remove obsolete patches.
Changelog:
https://github.com/flyinghead/flycast/releases/tag/v2.7
[3 lines not shown]
[NFC][DirectX] Fix memory leaks exposed by ASAN (#220152)
This PR should fix ASAN errors from
https://lab.llvm.org/buildbot/#/builders/52/builds/19811
There are three sources of leaks:
1. TargetPassConfig not being `PM.add()`ed
```
Direct leak of 136 byte(s) in 1 object(s) allocated from:
#1 ...createPassConfig(...) DirectXTargetMachine.cpp:216:10 <- return new DirectXPassConfig(*this, PM);
#2 ...addPassesToEmitFile(...) DirectXTargetMachine.cpp:177:34 <- TargetPassConfig *PassConfig = createPassConfig(PM);
Indirect leak of 144 byte(s) in 1 object(s) allocated from:
#1 llvm::TargetPassConfig::TargetPassConfig(...) TargetPassConfig.cpp:604:10 <- Impl = new PassConfigImpl();
#2 DirectXPassConfig DirectXTargetMachine.cpp:112:9
```
2. MachineModuleInfoWrapperPass not being `PM.add()`ed
```
[18 lines not shown]
[OpenMP][libomp] Fix dist barrier arrival synchronization (#213845)
Make distributedBarrier::stillNeed atomic and use release/acquire
ordering for distributed barrier gather arrival flags.
The old volatile stillNeed flag did not synchronize an arriving thread's
pre-barrier writes with the thread that observed its arrival. On weakly
ordered architectures, a group leader could observe stillNeed == 0
before the arriving thread's pre-barrier writes were visible. This
allowed another thread to pass the barrier and read stale data written
before the barrier.
Use release stores when publishing stillNeed == 0. Keep the spin loops
on relaxed loads, then perform one acquire fence after all expected zero
values have been observed. This connects the arriving threads'
pre-barrier writes to the observer through the standard release/acquire
happens-before chain, without using acquire loads on every poll.
The same pattern is used when a group leader publishes its own stillNeed
[106 lines not shown]
Fix layering violation from #220073 (#220150)
That PR introduced circular dependencies LLVMTransformUtils <->
LLVMPasses. Move Trigger*CrashPasses into LLVMPasses.
Move TriggerCrashFunctionLegacyPass alongside the one usage
`-codegen-pipeline-trigger-crash` just to prevent a tiny .cpp file.
kernel - Expand cpu_topology_nodes[] array
* Double the size of the array, which stores nodes as well as leafs
in the cpu topology tree. The array was being blown out in early
boot before if there were more than 128 CPUs.
* Add a KKASSERT() to catch any remaining issue, in case the tree
winds up being more complex and requires more nodes.
Reported-by: ivadasz
kernel - Move primary lockf management into struct vnode
* Move lockf management out of per-filesystem in-memory inodes and
into the general vnode structure. This will make follow-on work
easier and removes unnecessary code from various filesystem
implementations.
* Remove related implementations from fs code except for smbfs.
* Add optimization to avoid allocating struct lockf for LK_GETLK.
Allows filesystem lock scans to avoid allocating struct lockf
unnecessarily. Suggested by ryao.
* Just enable for existing filesystems that previously implemented it
in this commit. There may be a follow-up to enable it in the
default VOPS for all vnodes.
[SPIR-V] Always reject OpTypeVector with a non-standard width (#212685)
SPV_EXT_long_vector does not widen OpTypeVector past 4 components. Those
widths need OpTypeVectorIdEXT, so requesting the extension here was
wrong
[ADT][TableGen] Add UniquingSet, a FoldingSet with typed keys (#219630)
FoldingSet serializes a key into a FoldingSetNodeID to look a node up
and rebuilds the stored node's profile to compare against it. Where a
key can be read out of a node, neither is necessary.
UniquingSet reuses FoldingSetBase's storage, growth, removal and insert
token and replaces only the key: the node's `getKey()` supplies it, the
key type's `operator==` compares it, and DenseMapInfo hashes it inline.
An Info parameter overrides the key type or its hash. The hash cached on
each node keeps growth and erasure from calling `getKey()`, which a
DenseSet cannot avoid.
Prefer `UniquingSet` where a key can be read out of a node in O(1) and
the lookup key is built beside `getKey()`; keep FoldingSet for keys that
are wide, polymorphic or assembled at many call sites, where one Profile
helper keeps both sides consistent. insert asserts that a node hashes as
its lookup did.
[18 lines not shown]