[mlir-c] Add mlirEmitWarning and mlirEmitRemark (#206542)
Adds C API entry points for emitting warning and remark diagnostics, complementing the existing `mlirEmitError`.
Assisted by: Claude
nvme: bound the AER error log byte-swap by the fetched length
The Get Log Page request for the error log is clamped to
NVME_MAX_AER_LOG_SIZE, but the byte-swap loop iterated ELPE + 1
entries. A controller reporting more than 63 entries makes the loop
overrun the 4 KiB log page buffer.
Reviewed by: ngie, imp, adrian
Differential Revision: https://reviews.freebsd.org/D59626
nvme: do not touch INTMS/INTMC when configured for MSI-X
The single-vector MSI-X fallback installs the shared interrupt
handler, which masks interrupts through INTMS/INTMC around the
completion poll.
INTx and MSI are unaffected. Only MSI-X track the interrupt mode
and skip un/masking
Reviewed by: ngie, imp, adrian
Differential Revision: https://reviews.freebsd.org/D59637
[AArch64][SME] Drop ZA marker on tail calls and lower as sibling calls
A tail call from a function with live ZA state was previously prevented
from being lowered as a sibling call to have a CALLSEQ_START to glue
INOUT_ZA_USE to. This led to bogus stack restores.
We now drop the INOUT_ZA_USE marker on tail calls and can thus lower as
sibling calls if needed to take advantage of the existing correct stack
restore behavior.
This is safe to do since tail calls use TCRETURN and the MachineSMEABI
pass requires live ZA state to stay live across returns anyway.
[Clang] Restrict darwin-static-lib-universal.c in cross-builds (#225447)
A new test was added in 841dbaab188ecfa756d4c946f33b58758d34d339 which
will fail when run on macOS if macOS is not set as the default target.
This has previously been solved in other tests by further restricting
the REQUIRES line to also check the target.
[lldb][NativePDB] don't assert when a public symbol sits past its section (#225734)
Fix an assertion failure in `SymbolFileNativePDB::AddSymbols` when a
public symbol's offset doesn't agree with its section's size (happens
with real-world PDBs after incremental linking). Instead of asserting,
we now log and skip the size estimate for that symbol.
Also adds a regression test that crafts such a PDB and checks lldb
doesn't crash.
This fixes crashes in swiftlang.
CodeGen: Mark dead PHI destination copies dead in the LiveIntervals path
When PHIElimination lowers a PHI whose destination is dead, it records a
dead def in LiveIntervals but did not set the dead flag on the lowered copy's
def operand. The LiveVariables path set this via addVirtualRegisterDead.
Avoids "Instruction ending live segment on dead slot has no dead flag" verifier
errors once LiveVariables is removed.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
Reapply "[AMDGPU] Remove definition of hi16 for scalar registers (#197467)" (#201552)
This reapplies #197467. The regression uncovered by this PR has been
fixed in #223653 and a test was added to verify that
`llvm/test/CodeGen/AMDGPU/issue197467-virt-reg-rewrite-failure.mir`.
[DAG] Don't detect flippable signs in MinMax matchers (#220527)
The Min/MaxLike pattern matchers are the only pattern matchers that use
computeKnownBits. They're used to match a smax as a umax if the operands
are known positive and so forth.
However in practice it has no affect on real-world codegen as correlated
value propagation already does this transform earlier in the pipeline,
including for all the tests changed in this PR:
https://llvm.godbolt.org/z/Pr4Ec1xrv
Nothing in the backends will emit a min/max that needs re-transformed in
this way as far as I'm aware.
Removing computeKnownBits from these matchers allows us to remove the
match context in #218372, and saves some compilation time at O3
https://llvm-compile-time-tracker.com/compare.php?from=2f2aa940de68abcdfe4959ddd3b9a0741a7c2a16&to=b771556fb2a7e9c2cb0c853a4a71ea9641e5ede0&stat=instructions:u
[ELF] Retain relocation sections for GOT entries added by relaxOnce (#225594)
x86-64 and SystemZ relax GOTPCRELX/GOTENT and, in relaxOnce, revert
relaxations that turn out to be out of range or misaligned. The reverted
relocation needs a GOT entry, which in -pie/-shared needs a relative
relocation. If .rela.dyn (or .relr.dyn) was empty, it has already been
removed by removeUnusedSyntheticSections, triggering an assertion
failure.
Retain the section that will receive the relative relocations when
relaxOnce may add GOT entries, and recompute .dynamic in each iteration.
This also fixes a truncated .dynamic when PPC64 PI long-branch thunks
add the first relative relocations to .rela.dyn.
LLM-aided. Fixes #224011
[Clang] Fix integer promotion of bit-fields in statement expressions (#225597)
`Expr::getSourceBitField()` now looks through the final expression of a
statement expression to preserve the bit-field information. This allows
the existing integer promotion rules to correctly promote the bit-field
to `int`.
Also added a regression test for the issue.
Fixes #221542
[DirectX] Set TypedUAVLoadAdditionalFormats on UAV texture loads (#225484)
Fixes https://github.com/llvm/llvm-project/issues/225147
This PR makes the `TypedUAVLoadAdditionalFormats` shader flag get set on
UAV texture loads.
Assisted by: GPT 5.6 Sol
[Support] Remove cl::DefaultOption (#225609)
https://reviews.llvm.org/D59746 added cl::DefaultOption so that the
built-in -h could be overridden by llvm-objdump and llvm-readobj, which
have since moved to OptTable. The remaining overrides just call
PrintHelpMessage, so remove them along with the flag. -h and --help
keep working in every tool.
LLM-aided