[BPF] Find the call of an invoke that is not in the block of its label (#235217)
BPFUnwindLower looks for the call of an invoke behind EH_LABEL in the
same
block. A bool argument is extended when the call is lowered, after the
label
was emitted. That is a select, which is expanded to a branch, and the
call
ends up two blocks further:
bb.9: EH_LABEL; STORE_STACK_ARG; w5 = 1; if r2 < 65 goto bb.11
bb.10: w5 = 0
bb.11: call; EH_LABEL
Such a call didn't get unwind_goto, and the pad stayed in the function
with
nothing that jumps to it: "unreachable insn".
Follow the blocks from the label to the next label
[AArch64] Use Input files for inorder scheduling tests. NFC (#236115)
This makes use of the existing basic-instructions.s, neon-instructions.s
and sve-instructions.s for testing inorder cpus. The differences in
instructions are mostly additions, with some duplicates being removed.
[Support] Add mulDivNearest and use it to scale profile counts (NFC) (#235916)
BlockFrequencyInfoImplBase::getProfileCountFromFreq and MergeFunctions'
scaleToBlockCount both compute X * Y / Z rounded half up with a 128-bit
APInt, saturating to UINT64_MAX. Move this into mulDivNearest in
MathExtras, next to divideNearest, so that other code scaling profile
counts can share it.
mulDivNearest only uses APInt when the product does not fit in 64 bits,
which avoids allocating a 128-bit APInt in the common case.
scaleToBlockCount is removed and its only caller calls mulDivNearest
directly, guarding only against a zero total weight, since mulDivNearest
already returns 0 for a zero weight or block count. The assert on the
width of the result is dropped: the result now saturates, and a weight
never exceeds the total weight, which is the sum of the weights.
Possible non-NFC followup work: setBlockFreqAndScale and scaleProfData
(which round down and cap at MAXINT32 instead of 64).
[libc++] Increase the time budget for selecting LNT refinement commits (#236210)
The job keeps timing out on Linux where we have more commits benchmarked
than on macOS. I will also pursue reducing the execution time of the
tool in a separate change.
[DebugInfo][FLMD] Implement IR Printing/Parsing for FLMD context + nodes
This patch adds support for printing and parsing textual IR for the
MDFunctionLocalMetadata class and each of the MDNode classes, FLScope,
FLSrcLoc, and FLInlinedCall.
The display logic goes beyond that of typical MDNodes, primarily in that
the FLMD storage arrays are printed with each element on a separate line.
A flag is added that prints everything on a single line, which is
recommended for some machine-parsing cases, but not recommended for either
human-reading or testing, where one-entry-per-line aids clarity.
This patch does not yet add support for the update_test_checks, since that
involves some non-trivial work worthy of a separate commit.
[flang] Preserve the alignment attribute across stack/heap conversions (#234898)
Three places move an allocation between the stack and the heap and drop
any `alignment` attribute on the way: `createAllocMemFromAlloca` in
MemoryUtils, `insertAlloca` in StackArrays, and the stack-budget
accounting in AllocationPlacement. This patch copies the attribute
across in the first two and lets the third budget for the padding an
over-aligned alloca may need.
Nothing user-visible depends on this today: the only producer of an
aligned `fir.allocmem` is an ALLOCATE statement, which StackArrays
excludes by design, and flang's own temporaries carry no alignment. It
is groundwork for the alignment-directive series, where aligned locals
and temporaries will flow through these passes.
Stacked on #234897.
Assisted-by: AI
[AMDGPU][NFC] Document INV-only counters at function return (#235903)
In https://github.com/llvm/llvm-project/pull/220694 I copied the
behavior that `global_inv` from GFX12+ doesn't need to be drained at
function end to `buffer_inv` on GFX942/950. Neither of these assumptions
were documented, hence this PR.
Co-authored-by: OpenAI Codex <noreply at openai.com>
[lldb] Avoid a JSON text round trip in GetStatistics (#236159)
GetStatistics conversion does
json::Value -> std::string -> json::Value -> SBStructuredData
change it to
json::Value -> SBStructuredData.
Add tests.
[libc][math] Implement double precision cosh correctly rounded to all rounding modes.
Use shared exp(x) +- exp(-x) evaluations with sinh from https://github.com/llvm/llvm-project/pull/235097.
Assisted-by: Gemini for analysis and refactoring.
[libc][math] Implement double precision sinh correctly rounded for all rounding modes.
- Extend even/odd polynomial evalutions of exp(x) +- exp(-x) from single precision to
double-double and 128-bit fixed point.
- Optimize range reduction using the trict from previous exp implementation, combining
with the new fp-bitwise operations, and reapply it to exp and exp2.
Assisted-by: Gemini for analysis and refactoring.
[LifetimeSafety] Run the analysis when only a dangling-field-lambda-capture or dangling-global-in-main warning is enabled (#236095)
ShouldCheckSafety decides whether the per-function analysis runs based
on which warnings are enabled, but its list omitted
warn_lifetime_safety_dangling_field_lambda_capture and
warn_lifetime_safety_dangling_global_in_main. Enabling just
-Wlifetime-safety-dangling-field-lambda-capture or
-Wlifetime-safety-dangling-global-in-main therefore did nothing, unless
some other lifetime-safety warning happened to start the analysis.
Add the missing diagnostics to the list and cover both with a test.
Authored-By: Claude
rdar://191100248
[mlir][acc] Replicate privatized storage across active parallel dims (#235974)
`computePrivatizeMapFlags` derives replication flags for an
`acc.privatize` from its `par_dims`. `par_dims` records ownership: the
parallel levels a privatization or reduction is associated with.
`active_par_dims` records the launch dimensions that execute the op
unpredicated, and that is what `ACCCGToGPU` uses to lay out hoisted
private storage in the kernel: the `acc.private_local` view has one
leading dimension per active level and is indexed by the corresponding
block/thread ids.
`par_dims` and `active_par_dims` may differ. A vector-level array
reduction nested in a gang loop has ownership `par_dims([thread_x])`,
since its partial results are combined across threads, but its temporary
is allocated inside the gang loop, so its active dimensions are
`[block_x, thread_x]`. The host then maps the storage as
`vector_private` (one copy per thread), while the kernel indexes it as
`[num_gangs][num_threads][n]`. Every gang other than gang 0 accesses
memory past the end of the allocation.
[13 lines not shown]
[lldb][OpenBSD] Fix FindProcesses and process group/session IDs (#235403)
FindProcessesImpl() checked the whole match, including the name, before
reading the process arguments that provide the name, so it never found
anything. Leave the name out of the first check, as FreeBSD and NetBSD
do.
Also fill in the process group and session IDs from kinfo_proc, and
skip the getProcFile_Pid test on OpenBSD, which has no /proc.
This fixes the Host.FindProcesses, HostTest.GetProcessInfo and
Support.getProcFile_Pid unit tests.
[lldb][OpenBSD] Implement HostInfoOpenBSD::GetProgramFileSpec() (#235230)
GetProgramFileSpec() on OpenBSD always returned an empty FileSpec.
Use getexecpath(3) to look up the path of the running executable.
getexecpath() is only available on newer OpenBSD releases, so add a
HAVE_GETEXECPATH check to LLDB's generated config, as LLVM Support
does for getMainExecutable().
[libc++][test][NFC] Use correct number of digits for <numbers> ground-truth values (#233664)
Corrects the number of digits used for the `float` hexadecimal literals
for the `<numbers>` test. All literals are now exactly representable as
`float`. The tested values themselves are unchanged.
Noted here:
https://github.com/llvm/llvm-project/pull/222830#discussion_r3985465297
[AArch64][Windows] Fix tail call support. (#230429)
Fix a handful of problems with tail calls on Arm64 Windows:
* Add support for the `endc` unwind opcode, and use an `alloc_s`/`endc`
pair to tell the Windows unwinder about callee-pops functions.
* Ensure that we use a frame pointer in any function that does a
non-tail call to a callee-pops function that has stack-based arguments.
* Fix pointer authentication for tail calls where the stack-based
argument size differs from the caller's; we can't simply use `autibsp`
in that case because the stack pointer value will be different, so
authentication would fail. Restoring the link register and
authenticating it immediately prior to the epilogue fixes the problem.
Assisted-by: claude
rdar://189018874