[CMake] Fix Windows resource version fields (#243542)
Windows version resources can report 0 instead of strings such as
24.0.0git because CMake interprets the version string as a condition.
Preserve nonempty version strings and explicit overrides, and keep the
fallback for missing or empty values. Set numeric ProductVersion to
match numeric FileVersion instead of leaving it at zero.
AI assisted.
[mlir][reducer] Register dialect extensions in mlir-reduce (#247759)
mlir-reduce registered all dialects but not their extensions, so any
pass that needs an interface provided by a dialect extension failed. For
example running the inliner on IR with 'func' calls:
mlir-reduce input.mlir -opt-reduction-pass="opt-pass=inline test=..."
aborts in asserion builds with:
LLVM ERROR: checking for an interface (`mlir::DialectInlinerInterface`)
that was promised by dialect 'func' but never implemented. This is
generally an indication that the dialect extension implementing the
interface was never registered.
This PR calls `registerAllExtensions()` before creating the
`MLIRContext`, matching mlir-opt and links `MLIRRegistrAllExtensions`.
Size change: mlir-reduce grows from 137.3 MB to 142.3 MB (+3.8%). For
reference, mlir-opt which already registers all extensions is 225.0 MB.
[AMDGPU] Fold NOT into S_AND_SAVEEXEC to form S_ANDN1_SAVEEXEC (#247608)
When the condition of a divergent branch is the negation of a lane mask
that was computed in another block, the NOT cannot be folded into a
compare and we end up with:
s_n = S_NOT s_i
s_o = S_AND_SAVEEXEC s_n
Use S_ANDN1_SAVEEXEC, which sets EXEC to ~s_i & EXEC, instead. This is
available from GFX9.
This also handles the case where s_n and s_i are the same register, as
long as the result of the NOT has no other uses.
Assisted-by: Claude Fable 5.2 <noreply at anthropic.com>
[DAGCombiner] Extend the pass-through in masked load and gather ext folds (#247672)
`visitSIGN_EXTEND_INREG` and `visitAND` fold a `sign_extend_inreg` or an
AND mask of a masked load or masked gather into an extending load or
gather. All four folds passed the old pass-through to the new node.
After type promotion the pass-through lanes have unspecified upper bits,
which the removed `sign_extend_inreg` or AND used to set, so those lanes
reached the result unextended. On AArch64 with SVE this gives wrong
results from plain C at `-O2` (#246968): a pass-through of -31 converted
with `scvtf` gives 4294967265.
This applies the same extension to the pass-through, as
`tryToFoldExtOfMaskedLoad` already does for `sext` and `zext`. When the
masked load is frozen, the pass-through is frozen first, or replaced
with zero if it is undef or poison. An undef, poison or zero
pass-through folds away, so the usual vectorized loops don't change.
`masked_sload_passthru_sitofp`, `masked_zload_passthru_uitofp` and
`masked_gather_passthru_zext` are new tests for three of the folds. The
[7 lines not shown]
[SandboxVec][LoadStoreVec] Vectorize store chains whose loads have external uses
Loads that feed a store chain used to block vectorization whenever they
had more than one use. The store chain can now be vectorized even if the
loads have external uses. Once the scalar stores are erased, each
original load is rebuilt from the lanes it occupies in the new vector
load, and reinterpreted back to its original type if needed.
The legality check, canUnpack(), runs before any IR is created, so a load
whose lanes cannot be reinterpreted (for example, a non-integral pointer)
rejects the whole chain instead of leaving a partially rewritten block.
The unpacking itself is done by unpackIfNeeded() after the scalar stores
have been removed.
Co-authored-by: Cursor <cursoragent at cursor.com>
[lldb] Pass fortran compiler to lldb test suite. (#208298)
Modifies the LLDB test suite infrastructure to support passing a Fortran
compiler to the tests.
Specifically, this patch makes the following changes:
- Adds the --fortran-compiler argument to lldb-dotest, with
auto-detection fallback compilers.
- Adds FC to the build command so tests have access to the designated
Fortran compiler.
- Updates Makefile.rules to handle Fortran test file compilation via
F_SOURCES.
Part of the Add Fortran support to LLDB GSoC 2026 project.
[SPARC] Emit STT_SPARC_REGISTER symbols for .register (#246970)
The assembler ignored .register. GNU as records each application
register that 64-bit code declares as #scratch or with a symbol name
in an STT_REGISTER symbol, so that the linker can catch objects that
use %g2, %g3, %g6 or %g7 in conflicting ways. Do the same.
The symbol is global and undefined, its value is the register number,
and a #scratch register gets a symbol with an empty name. #ignore and
32-bit code emit no symbol. Like GNU as, reject a register declared
again in a different way and a symbol name that is already defined,
and check the .register syntax instead of skipping the line.
The code generator already declares %g2 and %g3 as #scratch in each
function that uses them, so those objects now get the symbols too.
Emit each register's symbol only once.
Keep the declarations in the target streamer, so that they are checked
across inline asm statements and against the declarations the code
[2 lines not shown]