[RISCV,test] Improve branch tests under linker relaxation (#247435)
Fix misspelled prefixes in long-conditional-jump.s.
Add +relax tests for long branch with --mc-relax-all.
[SandboxIR][Tracker] Fix bug in SnapshotChecker (#246098)
This patch fixes the issue in Tracker::accept() when not accepting all
that would not update the snapshot tracker leading to false positives in
EXPENSIVE_CHECKS.
[Clang][Driver][NFC] Generalize addDebugCompDirArg to addCompDirArg (#247135)
Generalize `addDebugCompDirArg` into `addCompDirArg`, which takes the
specific option and cc1 flag,
and use it for both `-fdebug-compilation-dir=` and
`-fcoverage-compilation-dir=`.
This prepares for handling `-fsanitize-compilation-dir=` the same way.
Part of #246884.
Signed-off-by: Björn Svensson <bjorn.a.svensson at est.tech>
[CodeGen] Preserve pseudo-probe contexts when matching common tails (#244667)
PR #219502 introduced `haveSamePseudoProbeContext()` to stop the
backward scan at probes or probe-annotated calls from different inline
contexts. The suffix already matched can still be shared when doing so
preserves the probes’ sampling locations. For example, two calls from
different contexts can stay in their original blocks and share a common
epilogue.
1. Tail merging can leave probes behind in the original blocks as seen
in repro: https://godbolt.org/z/6ndooP4oW.
In the repro, the matched suffix is `MOV`, `LEA`, and `RET`. Sharing it
leaves each original block with its own probe and at most a forwarding
jump. Both probes disappear with tail merging enabled and survive with
it disabled.
Branch folding can bypass a forwarding block, and `PseudoProbeInserter`
removes dangling probes from blocks without real instructions. At a
context mismatch, check the prefix that would remain in each block.
Reject the merge if either prefix would contain a probe without real
[31 lines not shown]
[InstCombine] Use input denormal mode when demanding subnormals for `frexp` in `SimplifyDemandedUseFPClass` (#246007)
Use the input denormal mode to determine which subnormal input classes
can produce a demanded signed zero in `frexp`. Previously, this treated
every input mode as dynamic, which blocked valid folds under IEEE,
PreserveSign, and PositiveZero.
Fixes #229317
[Object][Mips] Don't crash on unknown e_flags in getMIPSFeatures (#247403)
getMIPSFeatures() hit llvm_unreachable for any EF_MIPS_ARCH or
EF_MIPS_MACH value it did not list. The flags come from the input
file, so llvm-objdump -d aborted on objects with EF_MIPS_MACH_5900,
which LLVM itself emits for -mcpu=r5900, or with EF_MIPS_MACH_LS3A.
Ignore values that have no matching feature, and map
EF_MIPS_MACH_5900 to the r5900 feature.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
kern/kern_exit.c: fix decision to give back to real parent in proc_reap()
p_oppid records the reaper by pid only, and nothing updates p_oppid when
the reaper changes. When p_oppid no longer matches, proc_realparent()
falls back to p_reaper. In proc_reap(), the test p_oppid !=
p_pptr->p_pid is then still true, so proc_reap() "gives back" the child
to proc_realparent(). That resolves to the new reaper, which is already
p_pptr. proc_reparent() returns early, the reaper gets a spurious
SIGCHLD, and proc_reap() returns without reaping.
Another problem with p_oppid check is that a parked zombie is leaked
permanently under the new reaper if the reaper changes before the
debugger waits, because p_oppid keeps the old reaper's pid.
In proc_reap(), base the give-back decision on the resolved parent
instead of the pid comparison.
Reported by: llm-postcr
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
contrib/lutok: update generated headers/build glue
lutok and kyua have both been updated for the new tests and the adjusted
header layout.
MFC after: 1 week
MFC with: 5e4c3200cdc7 ("contrib/lutok: update to 0.7.1")
contrib/lutok: update to 0.7.1
This is a bugfix release. Users are encouraged to take this version.
MFC after: 1 week
Merge commit 'dac7d818e3cef52d724592c6b349dbd8ad9a049a'
contrib/lutok: compile/run tests from the project
This change adds the necessary glue to build and run the tests
distributed with each release, sans the examples tests. liblutok is
an "internal" library, so the headers and library aren't distributed
with installworld, et al, and thus the examples tests--which require the
headers/library to build tests on the fly--fail when the tests are run,
due to this difference with the upstream project.
MFC after: 1 week
[clang-tidy] Fix `modernize-use-ranges` fix-it for containers accessed through a pointer (#226739)
Fixes the pointer derenferencing with the help of
`fixit::formatDereference`. Most of the Diff is caused by
`RangeArg`refactoring.
Did not use StringRef as `formatDereference` returns a `std::string`.
Assisted by Codex for codebase exploration and utility usage.
Fixes #188257
Godbolt link from original issuer:
https://godbolt.org/z/7af31ox3j
[Clang][SYCL] Add a voided use of a variable used only in an assertion. (#247412)
The tree transform for UnresolvedSYCLKernelCallStmt contains a call to
SemaSYCL::GetSYCLKernelInfoClassSpecializationType() that is necessary
to provoke an implicit declaration of the requested specialization. The
return value is only used in an assertion which resulted in an unused
variable error in builds with assertions disabled. A voided use of the
variable has been added to suppress the error.
iflib: remove the legacy interrupt before freeing the queues
iflib_device_deregister() and the iflib_device_register() failure path
freed the queue structures and ran IFDI_DETACH before tearing down an
INTx or MSI handler. A shared INTx line can run the driver filter and
iflib_fast_intr_rxtx() at any time, so another device's interrupt in
that window used freed queues and driver state. Tear the handler down
before anything is freed.
Reported by: llm-postcr
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D62040
iflib: clear an interrupt after freeing it
em(4) and several other drivers free their MSI-X vectors when
IFDI_MSIX_INTR_ASSIGN fails, then free them again from IFDI_DETACH,
which iflib's attach failure path runs next. The second
iflib_irq_free() tears down a stale tag and releases a stale resource.
Clear both so it is a no-op.
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D62039
lutok: import lutok-0.7.1
This change adds lutok lutok-0.7.1 from upstream [1].
The lutok-0.7.1 artifact was been verified by SHA256 checksum [2].
This is a bugfix release.
The core issues addressed in this release relate to memory handling in edge
cases and a handful of build-related bugfixes found when enabling ASAN in CI.
A huge shoutout goes to @holmuk for the findings and fixes made in the library.
Users are encouraged to upgrade to this release.
More information about the release (from a high level) can be found in
the release notes [3].
Updated with [4] like: `update_lutok.sh 0.7.1 lutok-0.7.1`.
[5 lines not shown]
[ELF] Finalize merge sections in parallel (#246841)
Finalizes merge sections and looks up tail-merged string offsets with
`parallelForEach`. The output is byte-identical at any `--threads`
value.
The gain comes from tail merging, which only happens at -O2 and above.
[AMDGPU] Re-enable AAInstanceInfo in AMDGPUAttributor
This was enabled and then disabled because of its compile time impact. This
recent changes, the compile time issue should have been resolved.
[Flang] Avoid crash on invalid EQUIVALENCE objects (#244982)
An invalid EQUIVALENCE statement may introduce a symbol that is not a
data object into later offset computation. ComputeOffsetsHelper assumes
such symbols have ObjectEntityDetails when assigning COMMON block
information, which can cause a crash.
Check for ObjectEntityDetails before accessing object-specific
information.
Fixes https://github.com/llvm/llvm-project/issues/242269
[Attributor] Do not copy large value sets in `AAPotentialValues`
`AAPotentialValuesImpl::recurseForValue` copies all values of another position
into the state. For example, if a callee returns one of its arguments, the call
result takes the values of the call site operand. In a chain of calls where each
call gets the result of the previous call, each call result then has one more
value than the previous one. A call result also sees the new values of the
previous call only in the next fixpoint iteration, so a chain of N calls needs N
iterations, and a long chain hits the iteration limit.
In this PR, we just limit the number of values to copy to 7, and use the value
of the position itself otherwise. 7 is a magic number here, but it is sufficient
for most cases (telling from the fact that no existing test is affected by this
change).
This PR was assisted by AI but I reviewed all the changes.
[Attributor] Use call site values when the callee returns an argument
AAPotentialValuesCallSiteReturned takes the interprocedural values of a call
from the interprocedural return values of the callee. If the callee returns one
of its arguments, these values contain the arguments of all call sites, so each
call result also gets the values passed at all other call sites. This is not
necessary. If the callee has many call sites and the call results are passed to
other calls, the value sets also become very large.
If the callee returns only its arguments and constants, we just need to
translate these values to the call site for the interprocedural scope.
This PR was assisted by AI but I reviewed all the changes.