[lldb] Use the .pdata function start for a frame 0 that has no symbol (#227298)
When the current function has no symbol, the unwinder does not know
where the function starts.
It then uses the Windows x64 unwind info for "after the prologue", even
at the function's first instruction.
This gives a wrong frame address, so stepping over a call into static
CRT code (e.g.
[`puts`](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/puts-putws?view=msvc-170))
stopped inside it.
This patch takes the function's start from
[`.pdata`](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-pdata-section)
instead. Only Windows x64 images are affected.
Adds a minidump regression test.
feat(gisel): mirror trunc/xor/select demanded bits
Mirror SelectionDAG demand propagation, known-bits folding, truncation
of logical shifts, and XOR narrowing and constant simplifications.
Respect shared producers, legality and target profitability, including
AArch64 XOR/shift commuting. Preserve integer LLTs when narrowing.
Share XOR/shift profitability between selectors through ISelOpcode,
with selector-owned opcode tables and one target hook.
pf: Keep every chunk of a table that a ruleset defines
libpfctl sends a table definition in chunks of 256 addresses, each as
its own PFNL_CMD_INA_DEFINE. The kernel treated every chunk as a new
definition and replaced the shadow table, so only the last chunk
survived.
Mark the chunks after the first with PF_ID_APPEND and have the kernel
add them to the shadow table in progress. A request without the
attribute still replaces the shadow; one with it and no definition in
progress fails with EINVAL. Old kernels ignore the attribute, so both
halves are needed; the ioctl sends all addresses at once and is not
affected. Mask the flags userland passes to PFR_FLAG_ALLMASK, as
PFR_FLAG_APPEND is kernel-internal.
Add a test that defines a table of 1,000 addresses, also in an anchor.
Reviewed by: kp
Fixes: 219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
[2 lines not shown]
AMDGPU: Include callees in backend_stack_size PAL metadata
The stack size reported in the PAL metadata of a chain function should
include the stack sizes of any callees, since the consumers don't have
access to the call graph (this is especially important for whole wave
functions, because we don't even emit any PAL metadata for them). The
consumers are generally expected to allocate scratch based on the
maximum `.backend_stack_size` emitted for the functions in a pipeline.
They will also have to deal with recursion and indirect calls.
The `.stack_frame_size_in_bytes` metadata remains unchanged, i.e. it
represents just the stack size of the current function (without its
callees).
Assisted-by: AI
AMDGPU: Emit .backend_stack_size for entry points
Currently, the `.backend_stack_size` PAL metadata is only emitted for
functions, but some of the consumers expect it to exist for the entry
points too (without it, if the entry point uses more scratch than any
other functions in the pipeline then we will allocate too little
scratch).
The meaning is the same for entry functions as it is for non-entry
functions: the stack size of the current function plus any of its
non-chain callees.
Unlike `.scratch_memory_size`, this does not get rounded up to 16.
Assisted-by: AI
AMDGPU: Don't include stack size of chain callees
Chain callees are always tail called into and overwrite the caller's
stack. Therefore, their stack size should not be added up to that of
their caller when computing the resource usage.
Assisted-by: AI
Add support for signers to override the digest implementation.
Add the ability for a signing implementation to specify a digest
implementaiton. If no callback is defined, use SHA256.
The cache of fingerprints is suboptimally calculated as both SHA256 and
SHA512 of the signing public key (called cert in the code) instead of
detecting which types of hashes we have. This should probably be cleaned up
for the future to allow for a dynamic selection of hash implementation
instead of statically supporting the two.
signing: Phase 1 rework of external signing support.
Add variables for type, cmd, and key. Add associated setter calls.
Add pkg_repo_create_set_password_cb and add a setter call.
Remove the header for pkg_repo_create_set_sign. New impl should use the discrete calls.
Remove unneeded headers.
signing: Phase 2 rework of external signing support.
Get rid of the argv/argc style external command handling to using the
newer struct members. Since the process spawner just string joins all of
the argv components and runs it with sh -c, just do that directly.
Convert pkg_repo_create_set_sign to use new API calls.
Convert exec_repo handling of old style calls to the new API calls.
Also add some additional checks in the getopt handling.
[libc] Add gettext and gettext_l stubs (#233603)
Added stateless stubs for gettext and gettext_l behind
LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS. In the "C" locale, POSIX
requires the gettext family to return the input msgid pointer unchanged
without modifying errno.
Assisted-by: Automated tooling, human reviewed.
[NFC][analyzer] Untangle logic of tryRearrange (#233441)
Remove redundant and over-complicated parts of the `tryRearrange` logic
in `SimpleSValBuilder.cpp`. The new code is bug-for-bug equivalent to
the old one, but should be easier to understand.
This prepares the ground for follow-up changes that will address the
FIXMEs and perhaps apply other improvements in this logic.
[LLVM][CodeGen][SME] Fix vector bfloat-int lowering when in streaming mode. (#232386)
When lowering bfloat operations we typically rely on VectorLegalizer to
promote and split operations. This means custom lowering code can
sometimes see types it doesn't expect.
Fixes https://github.com/llvm/llvm-project/issues/232248
[InlineCost] Ask TTI whether unsimplified binops are free
visitBinaryOperator charged every unsimplified binary operator without
consulting TTI, unlike casts, GEPs and other instructions. Return TCC_Free
from TTI::getInstructionCost as visitCastInst does.
This is a reland of #232397 restricted to binary operators. Compares are
left out because very few compare are currently counted as free, yet
this where we started to spend the majority of the queries. Originally
this caused the compile-time regression that led to the revert (#232907).
[LoongArch] Compute known bits and sign bits for BSTRINS/BSTRPICK
BSTRINS and BSTRPICK are formed early by DAG combines, so the generic
known-bits and sign-bits analyses see them as opaque target nodes. When
such a value is live out of a block, its LiveOutInfo is lost and PHIs
merging it can no longer prove that the value is already sign- or
zero-extended, leaving redundant addi.w/bstrpick.d behind.
This is common in Rust code decoding UTF-8, e.g. `str::chars().rev()`,
where the multi-byte path assembles the code point with bstrins.d and is
merged with the ASCII byte loaded by ld.b before an i32 compare.
rustc-perf svg-parse-1 on LA664: instructions -2.4%, cycles -1.7%.
[NFC][analyzer] Clean up CheckerContext::addTransitionImpl (#231180)
The methods of `CheckerContext` that create exploded nodes (e.g.
`addTransition`, `generateErrorNode` etc.) had a very convoluted and not
entirely correct implementation with lots of tricky corner cases. The
situation was worsened by the fact that the comments accompanying this
logic were often misleading or even factually inaccurate.
For more details, see the discourse thread
https://discourse.llvm.org/t/simplifying-failure-modes-in-explodednode-creation/91542/8
This change tries to simplify this logic as much as possible, but
rigorously preserves bug-for-bug compatibility and the public API (even
when it does not make sense).
This will serve as a foundation onto which I can build separate commits
that fix the buggy logic and streamline the public API (to remove
redundancy that has caused serious misunderstandings in the past).
[analyzer] Fix missing ElementRef in ProgramPoint::withTag (#231515)
The method `ProgramPoint::withTag` intended to return a `ProgramPoint`
that is the same as the original, but has a different `Tag`. However,
when commit d65379c8d4768ddae143672f5d4827acafe22553 introduced the
field `ElemRef` in 2023, it forgot to mention it in this method, so now
the `ElemRef` of the `ProgramPoint`s returned by `withTag` was always
`{nullptr, 0}` instead of the intended value.
This commit fixes this oversight and restores the intended semantics of
`withTag`.
Issue reported by Claude at
https://github.com/llvm/llvm-project/pull/231180#pullrequestreview-5504002161,
commit was created manually.