[LoongArch] Propagate demanded bits for CRC[C].W.{B,H}.W
CRC byte and halfword instructions only use the low 8 or 16 bits of
their data operand. Propagate these demanded-bit requirements through
SimplifyDemandedBitsForTargetNode() so redundant masking operations can
be removed during DAG combining.
[mlir][CSE] Remove the opsToErase container and immediately delete dead ops. (#203702)
This PR removes the `opsToErase` container and immediately erases dead
operations. Since dead ops are deleted on the fly, the value in the
`MemEffectsCache` map now correctly tracks the previous operation of
`toOp`. This change improves the storage efficiency of CSE. Furthermore,
it is part of https://github.com/llvm/llvm-project/pull/180556 and
substantially simplifies the implementation.
[libclc] Use __CLC_SCALAR instead of nonexistant __CLC_SCALAR1 for sin (#203807)
Summary:
This seems to be a typo? Every other case is guarded by `__CLC_SCALAR`
but this case had a `1` after it. Removing this improved performance on
sin/cos/tan to match the ROCm version.
[libclc] Use FMA for the pi reconstruction in acos / atan (#203804)
Summary:
This should recombine the split constant for this case. The performance
should be negligible for such large math functions, we get an extra add,
but in exchange the results should improve 1 ULP.
This was primarily done to match what AMD's math libraries do, with this
change we are byte-for-byte identical in output.
[Passes] Invoke CGSCCOptimizerLateEP callbacks in LTO pipeline (#203262)
The CGSCCOptimizerLateEP extension point was not being invoked in the
LTO pipeline. Right now only AMDGPU registers any passes during this
callback, but it was a real source of delta between the LTO and default
pipelines when targeting AMDGPU. This doesn't seem to be an intentional
omission given that it is instantiated in thinLTO as well. Just add it.
[libclc] Improve performance and precision of reciprocal functions (#203805)
Summary:
Small change to improve the performance and output of functions using
the reciprocol. This makes these functions *byte-for-byte* identical
with their OCML counterparts in ROCm.
Additionally ensure tanpi is correctly rounded to match ROCm.
[X86][APX] Remove prefer-ndd-imm tuning (#203758)
It turns out NDD's immediate variants perform as good as non-NDD's on
real hardware. Verified both on CPU2017 and CPU2026, the geomean is
around 0 w/ and w/o this change. A few items get up and down due to the
side effect of register live range change caused by the NDD form. No
evidence shows this tuning has improvements or degradations even on
single items.
Assisted-by: Claude Sonnet 4.6
[mlir] mlir-opt-repl: add mcp-config command, fix readline on Windows
- 'mlir-opt-repl mcp-config' prints ready-to-paste Claude Code JSON
with absolute paths resolved for the current installation
- Handle missing readline on Windows (graceful degradation)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[LangRef] Clarify the `nsz` semantic for `{u,s}itofp` (#201557)
`nsz` has special semantic in `{u,s}itofp`, which falls into the "unless
otherwise mentioned" in `nsz` doc, this PR clarifies it in LangRef.
[lldb] Add static asserts on Symbol size to DataFileCache (#203735)
DataFileCache is a serialization to disk of a Symtab - the symbol names
and array of Symbol objects - so if the contents of the Symbol object
change, the serialization may need to change as well, and we need to
bump the DataFileCache version number to avoid misparsing an older
format.
It's also a little too easy to change Symbol and not notice that
Symbol::Encode/Decode and Symtab::Encode/Decode need to be updated.
static_asserting the size of Symbol isn't perfect, but as long as we're
doing it in Symbol.h already to warn anyone increasing the size of this
object, I want to use the same technique to make sure people look at
these other sites that are tied to the contents.
[mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server
A pip-installable Python package (mlir-opt-repl) that provides:
- An interactive terminal REPL for applying mlir-opt passes step by step,
with history navigation, rewind, and colored unified/side-by-side diffs.
- An MCP (Model Context Protocol) server for use as a Claude Code tool,
exposing the same functionality over JSON-RPC stdio.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] mlir-opt-repl v2: save, bookmark, verify, pass-pipeline syntax, tab completion
New features:
- save: write current IR to a file
- bookmark: name history steps for easy rewind-by-name
- verify: run --verify-diagnostics on current IR
- pass-pipeline syntax: 'run builtin.module(canonicalize,cse)' works
- tab completion: commands and pass names auto-complete with Tab
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server
A pip-installable Python package (mlir-opt-repl) that provides:
- An interactive terminal REPL for applying mlir-opt passes step by step,
with history navigation, rewind, and colored unified/side-by-side diffs.
- An MCP (Model Context Protocol) server for use as a Claude Code tool,
exposing the same functionality over JSON-RPC stdio.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] mlir-opt-repl v2: save, bookmark, verify, pass-pipeline syntax, tab completion
New features:
- save: write current IR to a file
- bookmark: name history steps for easy rewind-by-name
- verify: run --verify-diagnostics on current IR
- pass-pipeline syntax: 'run builtin.module(canonicalize,cse)' works
- tab completion: commands and pass names auto-complete with Tab
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server
A pip-installable Python package (mlir-opt-repl) that provides:
- An interactive terminal REPL for applying mlir-opt passes step by step,
with history navigation, rewind, and colored unified/side-by-side diffs.
- An MCP (Model Context Protocol) server for use as a Claude Code tool,
exposing the same functionality over JSON-RPC stdio.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server
A pip-installable Python package (mlir-opt-repl) that provides:
- An interactive terminal REPL for applying mlir-opt passes step by step,
with history navigation, rewind, and colored unified/side-by-side diffs.
- An MCP (Model Context Protocol) server for use as a Claude Code tool,
exposing the same functionality over JSON-RPC stdio.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server
A pip-installable Python package (mlir-opt-repl) that provides:
- An interactive terminal REPL for applying mlir-opt passes step by step,
with history navigation, rewind, and colored unified/side-by-side diffs.
- An MCP (Model Context Protocol) server for use as a Claude Code tool,
exposing the same functionality over JSON-RPC stdio.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[mlir][LLVM] Add the `byte` type to the LLVM dialect
This PR ports the newly added `byte` type from LLVM IR to mlir's LLVM dialect.
The simplest motivation for the byte type is being able to implement `memcpy` in LLVM IR. This was previously not possible: Due to rules around conversions between integers and pointers (which e.g. implicitly happen during loads), partial-poisons and pointer provenance were not preserved.
No alterantive types to integers existed that one could use to have poison and provenance preserving SSA-values. The byte type solves exactly this issue.
Frontends are encouraged to use it when needed for better optimization capabilities.
Currently, the only operation that has changed semantics around `byte` is `bitcast`. Is now allows casting between `byte` and `ptr` (unlike integers and pointers).
Corresponding LLVM commit: https://github.com/llvm/llvm-project/commit/80f2ef70f592
Assisted by Claude & Gemini
[X86] Remove shouldCastAtomicLoadInIR; use DAG combine instead (#199520)
Remove X86's shouldCastAtomicLoadInIR override that cast FP atomic loads
to integer at the IR level. Instead, handle this in a pre-legalize DAG
combine (combineAtomicLoad) that rewrites FP/FP-vector atomic loads to
integer atomic loads plus a bitcast.
This and #199310, which adds the necessary cmpxchg support for
non-integer atomic loads in AtomicExpand, are a response to
https://github.com/llvm/llvm-project/pull/148899 for `atomic_vec4_float`
of `atomic-load-store.ll`.
Stacked above #201303.
[LV] Use ResumeForEpilogue for header phi resume in epilogue plan (NFC) (#203786)
Pass the ResumeForEpilogue VPInstructions created by
preparePlanForMainVectorLoop into preparePlanForEpilogueVectorLoop and
get the resume IR from ResumeForEpilogue::getUnderlyingValue()
[LV] Drop the mask of a predicated store masked by the header mask. (#201676)
Drop the mask of a predicated store masked by the header mask (which is
guaranteed to be true at least for the first lane) and both the stored
value and the address are uniform across VF and UF.
An similar version for loads was included in
https://github.com/llvm/llvm-project/pull/196630, but restricted the
uniform-across-vfs-and-ufs did not have impact in practice.
For stores, this results in some improvements after
https://github.com/llvm/llvm-project/pull/196632.
PR: https://github.com/llvm/llvm-project/pull/201676
[BOLT] Zero alignment padding when reusing old text section (#202375)
With --use-old-text, the output starts as a byte-for-byte copy of the
input. Alignment padding between sections could retain stale data from
the original binary. Zero the padding so the result matches writing
sections to new file offsets.
[Github] Remove unnecessary packages from github-automation container (#203358)
This cuts the container size from 654 MB to 229 MB. This is mainly due
to removing the python3-pip package which was pulling in some big
depedencies like gcc.
A smaller container will be faster to download which will speed up the
workflow runs, but also, having less packages means smaller attack
surface for the container.
[llvm-cov] Replace binary test blobs with text formats
Replace .covmapping and .profdata binary blobs with .yaml (obj2yaml)
and .proftext respectively. The test now uses yaml2obj and
llvm-profdata merge to produce inputs at test time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>