[CIR] Honor the Direct coercion offset in x86_64 callconv lowering
When a record's low eightbyte holds no field, the classifier passes it in one
register read from byte 8 rather than byte 0. CallConvLowering had no way to
represent that, so `convertABIArgInfo` rejected the whole signature as NYI.
`ArgClassification` now carries the offset and `emitCoercionToMemory` reads and
writes the coerced scalar through a `u8` `cir.ptr_stride` at that byte. The
offset-zero path is untouched.
A register-tuple coercion at an offset is refused rather than read from the
wrong bytes, a pair SysV cannot currently produce.
Supersedes #203640, which had the coercion mechanism but nothing calling it.
Assisted-by: Cursor / claude-opus-5
Prevent pf dropping TCP state with crafted reset packet.
Revision 1.1212 of pf.c weakened the TCP reset check in stateful
connection tracking to let legitimate resets pass in the backwards
window. Such a reset is accepted only if its acknowledgment number
matches perfectly. But as a workaround for broken stacks, pf
replaces an acknowledgment number of 0 in a reset with the tracked
sequence of the peer. Then the perfect match always succeeds, and
an attacker can spoof resets more easily than intended. Use the
acknowledgment number from the wire, before the workaround has
modified it.
discovered by Minghao Zhang; OK sashan@
libclc: added version 21.1.8
libclc is an open source implementation of the library requirements of
the OpenCL C programming language, as specified by the OpenCL 1.1
Specification. The following sections of the specification impose
library requirements:
6.1: Supported Data Types
6.2.3: Explicit Conversions
6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
6.9: Preprocessor Directives and Macros
6.11: Built-in Functions
9.3: Double Precision Floating-Point
9.4: 64-bit Atomics
9.5: Writing to 3D image memory objects
9.6: Half Precision Floating-Point
libclc is intended to be used with the Clang compiler's OpenCL frontend.
[4 lines not shown]
[mlir][IR] Initialize empty dialect resource handles (#220585)
A default AsmDialectResourceHandle leaves its dialect pointer
indeterminate. Initialize the pointer to null and test all
default-handle accessors.
Valgrind pre-fix trace:
```
OpImplementationTest.cpp:19: Failure
Expected equality of handle.getDialect() and nullptr
handle.getDialect() was 0x120b508
1 FAILED TEST
```
Found by Coverity.
Assisted-by: Codex
[mlir][IR] Initialize empty AsmResourceBlob mutability (#220586)
The default constructor leaves dataIsMutable indeterminate even though
isMutable may be called on an empty blob. Treat default-constructed
blobs as immutable and cover that state with a unit test.
Valgrind pre-fix trace:
```
Invalid read of size 8
at testing::Test::Run()
Invalid write of size 8
Invalid free() / delete / delete[] / realloc()
ERROR SUMMARY: 6 errors from 6 contexts
```
Found by Coverity.
Assisted-by: Codex
[flang-rt] Resolve unit test shared library paths (#220693)
This PR resolves a problem with finding the libflang_rt.runtime.so
library when running flang-rt unit tests whose failure looked like:
FAIL: flang-rt-Unit ::
Runtime/CUDA/./FlangCufRuntimeTests/failed_to_discover_tests_from_gtest
(1 of 17)
******************** TEST 'flang-rt-Unit ::
Runtime/CUDA/./FlangCufRuntimeTests/failed_to_discover_tests_from_gtest'
FAILED ********************
********************
FAIL: flang-rt-Unit ::
Runtime/./RuntimeTests/failed_to_discover_tests_from_gtest (2 of 17)
******************** TEST 'flang-rt-Unit ::
Runtime/./RuntimeTests/failed_to_discover_tests_from_gtest' FAILED
********************
[25 lines not shown]
[LV] Add tests for epilogue vectorization of folded bypass checks (NFC). (#220703)
Add vplan printing and branch weights tests with various cases where
parts of the epilogue skeleton can be folded.
[AMDGPU] Add getLocalMemorySize to TargetParser
Add getLocalMemorySize(GPUKind, bool FullSIMDMode) and the SubArchType
overload, returning the LDS a work-group can reach, so it can be
queried from a GPU name alone without an MCSubtargetInfo.
The number of SIMDs a work-group runs on is a per-kernel mode rather
than a property of the GPU, so it stays a parameter. GCNSubtarget
initializes its cached LocalMemorySize from the new entry point. There
is no functional change.
Change-Id: I9c0b281af6163f6d06d30b847c644915f3a654d8
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[AMDGPU] Expose LDS block and flat scratch features to TargetParser
Add FeatureHalfAddressablePhysicalLocalMemory and
FeatureArchitectedFlatScratch to AMDGPUFrontendVisibleFeatures so
TargetParser carries them in its per-GPU feature bitset.
Both are listed in FrontendOnlyFeatures, so clang does not serialize
them into the target-feature string: they are capabilities implied by
the subtarget, not user-selectable.
Change-Id: I47a641eb8069a440da99f49708ad8059dd412690
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[msan] handle modf, sincos and sincospi intrinsics (#220416)
These intrinsics compute two values from a single floating-point (or
vector of floating-point) operand, returning a 2-element struct {T,T}.
Because of the struct return type, they bypass the generic nomem
intrinsic heuristic and fall back to strict operand shadow checks in
visitInstruction. This causes false positives on vector operations with
inactive/masked lanes, and zeroes out the result shadow.
Fix this by propagating the operand shadow and origin to both elements
of the result struct.
[clang][docs] Add basic user documentation for Hardware-assisted AddressSanitizer (HWASan) (#220075)
Create a basic user-facing guide for Hardware-assisted AddressSanitizer
(HWASan / `-fsanitize=hwaddress`) covering:
- Overview of HWASan and detectable bug types
- Supported platforms
- Basic usage example and crash report
- Passing runtime options via `HWASAN_OPTIONS`
- Disabling instrumentation via attribute and feature check
- Link to `HardwareAssistedAddressSanitizerDesign` for details
Co-authored-by: Gemini <noreply at google.com>
---------
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
Co-authored-by: Gemini <noreply at google.com>
iflib: Do not hold the ifnet lock across registration
iflib_device_register() acquired IFNET_WLOCK to preserve lock order
when ether_ifattach() was called with the context lock held. The context
lock is now released around ether_ifattach(), making registration-wide
ifnet serialization unnecessary.
Keeping IFNET_WLOCK across driver attachment also allows synchronous
interface event handlers to recurse on it. The rtnetlink interface-group
dump does so through if_foreach_group() while handling the interface
attachment event.
Remove the outer lock and the corresponding failure-path unlock and
relock transitions. Continue to drop the context lock around
ether_ifattach() and taskqueue drains, and preserve context-lock coverage
for driver attach and detach.
Validated under WITNESS on 82576 and I226 controllers. Multiple VF
attach and detach cycles, netmap control operations, and every iflib
[12 lines not shown]