[SystemZ,test] Cover non-preemptible PLTOFF (#195600)
R_390_PLTOFF{16,32,64} against a non-preemptible (hidden) symbol takes
fromPlt(R_PLT_GOTREL) → R_GOTREL in RelocScan::process so the relocation
resolves to symbol - .got with no PLT entry. Add tests to fix the
the test gap from the initial SystemZ port
(fe3406e349884e4ef61480dd0607f1e237102c74).
[libc++] Remove libc++'s own fenv.h (#194629)
Our own `fenv.h` only `#undef`s macros which the C header might define.
None of the libcs we support define any of these functions as macros, so
we can simply drop the header.
[libc++] Remove libc++'s own ctype.h (#194615)
Our own `ctype.h` only `#undef`s macros which the C header might define.
None of the libcs we support define any of these functions as macros, so
we can simply drop the header.
[libc++] Simplify more <random> engines (#195504)
This uses `if _LIBCPP_CONSTEXPR` to simplify and deduplicate some of the
code for the random engines.
[OpenMP][mlir] Add Groupprivate op in omp dialect. (#162704)
This PR adds omp.groupprivate mlir op to omp dialect.
The groupprivate directive specifies that variables are replicated, with
each group having its own copy. The operation takes a symbol reference
to a global variable and an optional device_type attribute, and returns
the address of its groupprivate copy.
Op representation:
`%gp = omp.groupprivate @global_var : !llvm.ptr`
`%gp = omp.groupprivate @global_var device_type(any) : !llvm.ptr`
LLVM IR translation:
On target devices (AMDGCN/NVPTX), the op is lowered to a new global
variable in the shared address space
On the host, the original global address is used as a fallback.
[libc] Enable socket entrypoints in overlay mode (#195035)
This is slightly tricky in that many of these functions depend on types
(struct sockaddrs, msghdr, ...) and we cannot overlay types. However,
this works because these functions are simple syscall wrappers which
simply forward the data to the kernel -- so it's really the kernel
that's defining these structures.
This approach is compatible with libraries which implement these
functions the same way, this includes at least glibc (on all
architectures) and musl (on 32-bit architectures). 64-bit musl repacks
the [c]msghdr structures to zero out padding fields, and overlaying that
can lead to subtle bugs. However, I believe that overlaying musl is not
a very interesting use case, so I'm leaving that as a TODO. If someone
is interested in doing that, they can either exclude these entrypoints
from the overlay or implement the musl-compatible repacking code.
[clang][RISCV] Use macro to check if intrinsics are supported (#187197)
Normally intrinsic support is decoupled from assembler support which
means we cant simply use arch string to check if intrinsics are
supported. This patch defines macros \__riscv_intrinsic\_{EXTENSION}
to check whether the intrinsics of EXTENSION is supported by this
compiler.
c-api-doc PR: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/183
[AMDGPU][SIInsertWaitcnts][NFC] Remove HasExtendedWaitcnts from printer
The debug output no longer needs to distinguish between pre-gfx12 and
gfx12+ counter names. Drop the HasExtendedWaitcnts boolean from
getInstCounterName, Waitcnt::getPrintable, print, and dump, keeping
only the extended (gfx12+) names unconditionally.
Assisted-By: Claude Sonnet 4.6
[clang-tidy] Skip user headers named like C headers in `modernize-deprecated-headers` (#195507)
Previously `modernize-deprecated-headers` would match on any header with
the same name as standard library headers. This commit fixes the problem
by checking whether the include resolves to a system header.
Closes #45991
---------
Co-authored-by: Victor Chernyakin <chernyakin.victor.j at outlook.com>
[clang][bytecode] Create global variables for temporaries... (#195037)
... that are extended by other global variables.
If the temporary we create is extended by a variable that we index as a
global, create a global for the temporary, even if it's not an
`SD_Static` temporary.
[clang-format] Make ignored files unformatted instead of empty. (#170416)
Tools rely on the expectation that clang-format will output a formatted
file. In the case of ignored files, the formatted file should just be
the input file, untouched.
Fixes #170407
MCContext/TargetMachine: Take MCRegisterInfo and MCSubtargetInfo by reference. NFC (#195032)
Both MCRegisterInfo and MCSubtargetInfo are non-null at every callsite
that matters (only nullable in unit tests like
`llvm/unittests/CodeGen/MFCommon.inc`), mirroring the recent `const
MCAsmInfo &` cleanup.
* TargetMachine::getMCRegisterInfo and getMCSubtargetInfo return
references.
* MCContext's constructor takes const MCRegisterInfo & and
const MCSubtargetInfo &.
[libc][math] Refactor rint-nearbyint family to header-only (#195577)
Refactors the rint-nearbyint math family to be header-only.
part of: #147386
Target Functions:
- nearbyint
- nearbyintbf16
- nearbyintf
- nearbyintf128
- nearbyintf16
- nearbyintl
- rint
- rintbf16
- rintf
- rintf128
- rintf16
- rintl
[4 lines not shown]
[flang][NFC] Converted more tests from old lowering to new lowering (part 55) (#195291)
Converted tests:
- Lower/Intrinsics/ieee_unordered.f90
- Lower/Intrinsics/rrspacing.f90
- Lower/structure-constructors.f90
- Lower/transformational-intrinsics.f90
Removed test:
- Transforms/stack-arrays.f90: tested the stack-arrays pass on the
legacy --array-value-copy output of legacy lowering. The HLFIR pipeline
produces fundamentally different code for array slice copies
(_FortranAAssign with fir.embox of sub-slices instead of allocating a
temp via array-value-copy), so the test's premises no longer apply. The
HLFIR equivalent test already exists at
Transforms/stack-arrays-hlfir.f90.
[llubi] Add support for poison-generating/UB-implying annotations (#195339)
This patch adds support for poison-generating/UB-implying annotations,
including:
1. Parameter/retval attributes on function declarations and call sites
(range/nofpclass/align/nonnull/noundef/dereferenceable[_or_null]).
2. Metadata
(!range/!nofpclass/!align/!nonnull/!noundef/!dereferenceable[_or_null])
3. Assume operand bundles (nonnull/align/dereferenceable[_or_null])
I put all of them into a single patch as they share most of the common
logic.
Note that there are two todos to reach the full support:
1. Load with `!noundef` metadata doesn't check undef bits for now.
2. !dereferenceable[_or_null] on load (and inttoptr) are not tested by
this patch, as it needs the provenance support
(https://github.com/llvm/llvm-project/pull/185977). But it should be
fine as they are tested by metadata on call sites.