t_arc4random: Fix test to guarantee global state initialization.
Previously, if pthread_atfork failed, arc4random_global_buf would
fail to initialize the global state as intended. (There are separate
tests for intentional failure of global state initialization.) It is
unlikely for pthread_atfork to fail, but with RLIMIT_AS cranked down
to zero, it may. To ensure that the global state is successfully
initialized for the tests that are trying to exercise it, call
arc4random from another thread first before forcing failure of the
local state initialization.
PR lib/59117: arc4random has some failure modes it shouldn't
[IR] Reject va_arg with an aggregate type in the verifier (#225091)
No target can lower `va_arg` with an aggregate type, and the reference
clang codegen never emits one: it expands `va_arg` of an aggregate into
accesses to its members in the frontend. Instead of rejecting such a
`va_arg`, the code generator crashed on it: SelectionDAG hit "Unknown
type!" in `MVT::getVT()`, and the IRTranslator hit "attempt to get
single VReg for aggregate or void". Make it invalid IR in the verifier,
and change LangRef to say the type must not be an aggregate, rather than
that the code generator does not support it.
ClangIR still emits an aggregate `va_arg` while it lacks calling
convention lowering, in `CIR/CodeGen/complex.cpp` (`{ float, float }`)
and `CIR/CodeGen/var-arg-aggregate.c` (`%struct.Bar`). Their CIR-to-LLVM
runs now fail verification, so this moves `foo33` into its own test and
drops the CIR-to-LLVM checks for these two cases, with a TODO to restore
them once CIR lowers them the way the reference codegen does.
Fixes #162900.
Assisted-by: Claude (Anthropic)
[Flang] Github action to check for full-pipeline tests (#221766)
Detect usage of full-pipeline tests (using-emit-llvm, -emit-llvm-bc,
and -emit-obj flags) in flang. Encourage contributors to use
focused tests or explain why full-pipeline coverage is needed.
Run detection with read-only permissions and pass comment updates
through a workflow-args artifact to the existing issue-write workflow.
Update the reminder as findings change and mark it resolved when no
additional invocations remain.
The reminder is informational and does not fail the check.
Discussed in
https://discourse.llvm.org/t/removing-or-reducing-redundant-messages-in-integration-tests/91591
Assisted-by: Codex
Co-authored-by: Eugene Epshteyn <eepshteyn at nvidia.com>
pf: first-match-wins for nat rules, even in anchors
Ensure we stop evaluating nat rules if we find a match in a nat-anchor.
PR: 299320
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit b5219c068fbc133dde91d5cf48423e34ce27bd4f)
RuntimeLibcalls: Use correct type for LDbl (#233799)
Use the Module / Triple's correct long double type. Previously this
was hardcoded to assume double.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[DebugInfo] Visit static data member declarations in DebugInfoFinder.
types() skipped the class of a static data member when the class was
only reachable through the global variable's declaration.
Co-authored-by: Cursor <cursoragent at cursor.com>
[OpenMP] Drop optimistic attributes from taskloop bound arguments
Under the default off -openmp-ir-builder-optimistic-attributes flag the
loop bounds get attributed as captures(none) nofree.
Changing them to AttributeSet() removes those claims from the
__kmpc_taskloop and __kmpc_taskloop_5 declarations. The runtime uses
the bounds' addresses to locate the bounds for each task it creates.
Even though the memory also reachtes the runtime through the task
argument the claims in the IR about the arguments are still wrong.
[X86][NFC] Do not alias different CPUs (#231289)
#211953 replaced duplicated ProcModel definitions with ProcessorAlias,
which is a good fit for alternate spellings of one CPU
(pentium_4/pentium4, skylake_avx512/skylake-avx512,
arrowlake_s/arrowlake-s). However, it also turned two distinct CPU into
aliases: grandridge as sierraforest and wildcatlake as pantherlake.
These are not alternate names. They are different processors that happen
to share features, tuning and scheduling model today. The rest of LLVM
already treats them that way: Host.cpp and X86TargetParser.def.
In contrast, arrowlake_s is marked dispatch-only, i.e. a spelling
variant.
[SPIRV] Emit DebugLexicalBlockDiscriminator for a DILexicalBlockFile.
A location scoped at a DILexicalBlockFile was emitted as a DebugScope of the compilation unit, so the discriminator did not round-trip.
Use the discriminator as the DebugScope operand, matching SPIRV-LLVM-Translator.
[SPIRV] Drop --verify-machineinstrs from new lexical-block RUN lines.
The machine verifier already runs on the buildbots.
Co-authored-by: Cursor <cursoragent at cursor.com>
[SPIRV] Expect no unlisted DebugTypeMember in the self-pointer forward-refs test.
Without forward references, member next is no longer emitted after S and
its pointer, since S cannot list it.
Co-authored-by: Cursor <cursoragent at cursor.com>
[libc] Add remaining <libintl.h> gettext stubs (#233838)
Added stateless stubs for dgettext, dgettext_l, dcgettext, dcgettext_l,
ngettext, ngettext_l, dngettext, dngettext_l, dcngettext, and
dcngettext_l behind LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS,
completing the 15 POSIX.1-2024 <libintl.h> entrypoints.
In the "C" locale, POSIX requires the dgettext and dcgettext families to
return the input msgid pointer unchanged and the ngettext, dngettext,
and dcngettext families to return msgid1 when n == 1 and msgid2
otherwise, without modifying errno.
Assisted-by: Automated tooling, human reviewed.
[IR] Compare the function type of calls (#233827)
The called function type is not an operand, so neither hasSameSpecialState
nor FunctionComparator::cmpOperations compared it. SimplifyCFG hoisted and
MergeFunctions merged calls that differ only in signature (fixed vs.
varargs), even though such calls are lowered differently.
[AArch64][SME] Set inline incompatibility for SME using cost-model.
Instead of maintaining a new switch-statement where we handle
individual intrinsics, rely on the TTI cost-model to check if
an intrinsic can be inlined into a streaming function.
hastd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D60729
auditdistd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.
Sponsored by: Klara, Inc.
Sponsored by: Qualys, Inc.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D60728
[CIR][OpenMP] Add initial support for distribute
This patch adds initial support for the OpenMP 'distribute' directive. Basic
code generation for the standalone and combined cases is introduced. Support
for clauses will be added in the future. The composite 'teams distribute
parallel for' form will be added in a subsequent patch.
Assisted-by: Cursor / Claude Sonnet 5 High
[SPIRV] Drop --verify-machineinstrs from new forward-ref tests.
The machine verifier already runs on the buildbots.
Co-authored-by: Cursor <cursoragent at cursor.com>
[SPIRV] Forward-reference debug scopes with a reserved result id.
Visiting a scope reserves its result id. With SPV_KHR_relaxed_extended_instruction a back edge uses that id through OpExtInstWithForwardRefsKHR, and a later failure defines it as DebugInfoNone when an emitted instruction already named it.
Without the extension the edge is dropped and a later walk can retry the scope.
[SPIRV] Emit each debug scope from getOrCreateDebugScope.
Handlers return the opcode and the operands. getOrCreateDebugScope writes that instruction with a fresh id.