[lld][Hexagon] Fix TLS GD PLT to only create PLT entry for __tls_get_addr (#180297)
Previously, R_HEX_GD_PLT_* relocations would create PLT entries for TLS
symbols like 'foo' in addition to __tls_get_addr.
This fix skips NEEDS_PLT on TLS symbols with R_HEX_GD_PLT_*, creates
__tls_get_addr symbol earlier with NEEDS_PLT, changes
hexagonTLSSymbolUpdate to only rebind relocations.
Also a test for the edge case where a GD_PLT relocation directly
references __tls_get_addr which previously caused a crash due to
duplicate PLT entry creation.
---------
Co-authored-by: Fangrui Song <i at maskray.me>
[Hexagon] Fix B0 macro conflict between hexagon_types.h and termios.h (#184539)
POSIX termios.h defines `#define B0 0000000` for baud rate 0. This
conflicts with the B0() member functions in hexagon_types.h vector
classes, causing compilation failures when both headers are included.
Use #pragma push_macro/pop_macro to save, undefine, and restore B0
around the class definitions so the header is safe to use alongside
termios.h without losing the macro afterward.
Fixes #183815
(cherry picked from commit b84ea71e2a81b3e51fa84d611bfc4a3416adc42c)
[Hexagon][XRay] Fix sled layout and trampoline to preserve retaddr (#188784)
The Hexagon XRay sled was 5 words (20 bytes) and the patched sequence
clobbered r31 (the link register) via callr without saving it first.
When the trampoline returned, the instrumented function's own allocframe
would then save the wrong return address, causing a crash or misrouted
return.
Expand the sled to 7 words (28 bytes) and wrap the call with
allocframe(#0)/deallocframe so the caller's r31:30 are preserved across
the trampoline call.
Detailed fixes:
- HexagonAsmPrinter: emit 6 nop words after the jump (7 words total)
- xray_hexagon.cpp: patch allocframe(#0) as first word, immext+r7 (func
ID), immext+r6 (trampoline), callr r6, deallocframe; write the first
word last for atomicity
- xray_trampoline_hexagon.S: complete rewrite -- properly load and
dereference the global handler pointer, save/restore r0-r5 and r31, add
[3 lines not shown]
[WebAssembly][NFC] use getOneBitSet instead init + shifting for APint (#188552)
This is valid due to `ShiftAmt < BitWidth` which is ensured by early
`ShiftAmt.uge(MaxValidShift)` testing.
snd_uaudio: Retire sndcard_func usage
This is effectively a no-op, as it does not make use of the
sndcard_func->varinfo field, so eventually ua_probe() always succeeds.
Also change ua_probe()'s value to 0. There is no need to return
BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
with bus_attach_children().
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56160
[compiler-rt][ARM] Rename endian.h to crt_endian.h (#189336)
Apparently on macOS there's a system header file also called
arm/endian.h, and another system header #includes it with "" rather than
<>, so that this compiler-rt header accidentally shadows it. Worked
around by prefixing "crt" to the name.
No changes are needed except the rename, because the planned functions
that use this header are still under review.
[DAG] Add initial version of SelectionDAG::computeKnownFPClass (#188790)
This patch adds an initial skeleton for `SelectionDAG::computeKnownFPClass`.
The initial version includes:
- DemandedElts wrapper and max depth early-out
- `ConstantFPSDNode` and `BUILD_VECTOR` handling
- `TargetLowering::computeKnownFPClassForTargetNode` virtual hook for backend extensions
Initial test coverage for constant scalars, BUILD_VECTOR, and max depth
early-out is added in `AArch64SelectionDAGTest.cpp`.
closes #175571
[libc++] Don't upload Docker image tarballs as artifacts (#188845)
These steps fail because the tarballs are too large, so we might as well
just not do it.
[libc][NFC] Guard long double type in shared_math_tests. (#189373)
Skip long double tests when long double is double-double.
Also adjust constant literals.
pkgbase: Move all of ATF into the atf package
Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.
PR: 294129
MFC after: 1 week
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D56158
pkgbase: Move all of Kyua into the kyua package
Some Kyua directories were improperly tagged as belonging to the tests
package. Move them to the kyua package, which contains all of the
files found in these directories.
PR: 294129
MFC after: 1 week
Reviewed by: ivy, emaste
Differential Revision: https://reviews.freebsd.org/D56159
[mlir][acc] add VariableInfo attribute to thread language specific information about privatized variables (#186368)
Add a new acc::VariableInfoAttr attribute that can be extended and implemented by
language dialects to carry language specific information about variables that is
not reflected into the MLIR type system and is needed in the implementation
of the init/copy/destroy APIs.
A new genPrivateVariableInfo API is added to the MappableTypeInterface to generate
such attribute from an mlir::Value for the host variable.
The use case and motivation is the Fortran OPTIONAL attribute. This patch adds
a new fir::OpenACCFortranVariableInfoAtt that implements the acc::VariableInfoAttr
to carry the OPTIONAL information around.
[DAG] SimplifyDemandedBits - limit BITCAST -> FGETSIGN fold to custom/legal scalar SimplifyDemandedBits cases (#189363)
All of the non-i32 zero_extend codepath is unaffected by this
Pulled out of the discussion on #189129