[AArch64] Fix accumulator chain opcode for SABAv2i32 (#226062)
A typo in `AArch64InstrInfo::getAccumulationStartOpcode` caused
`SABAv2i32` to be matched instead of `SABDv2i32`.
Fixes #225984
[SystemZ] Fix zero length PR section for zero size BSS globals (#225863)
PR sections must have a non zero length. This was already handled for
ADA sections via requiresNonZeroLength(), but not for BSS globals
declared with zero size. This change extends the existing inflation to
also cover BSS PR sections.
---------
Co-authored-by: Yusra Syeda <yusra.syeda at ibm.com>
[CodeGen] Use validated wave counts for AMDGPU spill costs
Lane-based block frequencies can understate the cost of a spill in
divergent GPU code: a wave still executes a block with only some lanes
active. Use measured block-wave counts to weight SpillPlacement's costs
relative to the original entry-wave count.
Opt in on AMDGPU only. Accept a measured count only when its IR block
maps uniquely to a machine block with matching predecessors and
successors. Keep the existing MBFI cost for unmeasured or rejected
blocks, and leave branch probabilities and general BFI unchanged.
[Transforms] Preserve wave profiles across CFG rewrites
HIP device PGO attaches measured wave counts to IR blocks. Later CFG
rewrites can drop counts from unchanged blocks or leave stale counts
on blocks that now execute differently. Either case makes the profile
unreliable for later optimizations.
Preserve counts through switch lowering, structurization, and loop
rotation only when a block still represents the same executions. Keep
unaffected counts and their IDs even when a loop header's count must be
invalidated. Transfer branch hints only for equivalent decisions, and
avoid assigning switch weights when default traffic cannot be traced
to one edge.
[yaml2obj] Migrate to OptTable (#224964)
yaml2obj is one of three tools that parse with
cl::ParseCommandLineOptions(LongOptionsUseDoubleDash=true). Parse its
options with an OptTable instead, so that the mode can be removed from
cl::. Spellings follow the other migrated tools: -D<macro>=<v> and
-D <macro>=<v>, -o<file> and -o <file>, --docnum=<n> and --docnum <n>,
--max-size likewise, -E, -h/--help and --version. `-o=<file>` is no
longer accepted; the tests that used it are updated. `--help` lists
only yaml2obj's options.
LLM-aided
[lldb] Add plugin for Clang offload bundle object container (#222362)
## Summary
Clang supports embedding binaries using the clang offload bundler:
https://clang.llvm.org/docs/ClangOffloadBundler.html
This patch creates an ObjectContainer plug-in that allows us to get the
contained binaries within any executable.
### why we need this?
AMD/HIP host binaries may contain a .hip_fatbin section holding a Clang
offload bundle with one or more AMDGPU ELF code objects, typically for
different GPU architectures. Each ELF code object can contain multiple
ml kernels.
### Test
[11 lines not shown]
[FMV][AIX] Implement target_clones part 2 (target-features) (#206786)
This is part 2 (of 2) of FMV on AIX that would allow specifying
target-feature strings on the ``target_clones`` attribute. Part 1 was in
#177428.
The list of attributes supported is a subset of the attribute accepted
on the `target` attribute on AIX, specifically those that are runtime
detectable via the `__builtin_cpu_supports` builtin.
---------
Co-authored-by: Wael Yehia <wyehia at ca.ibm.com>
[DirectX] Support `cmpxchg` on buffer resources in DXIL lowering (#222162)
This PR is a backend change alone. It teaches DXIL lowering to handle a
`cmpxchg` on a buffer resource pointer, which the
`InterlockedCompareStore`
and `InterlockedCompareExchange` PRs above it in this stack need.
The PR adds:
- the `llvm.dx.resource.atomic.compare.exchange` intrinsic,
- its DXIL operation and op lowering,
- the `DXILResourceAccess` handling that turns a `cmpxchg` on a value
returned by `llvm.dx.resource.getpointer` into that intrinsic.
DXIL has no atomic compare exchange for texture resources, so the pass
reports an error for them. A test covers that path.
There is no Clang change here, and no HLSL function becomes available.
Assisted by: Github Copilot
[HLSL] Add `InterlockedExchange` function and resource methods (#222161)
This PR adds the `InterlockedExchange` standalone function and resource
methods. The operation lowers to `atomicrmw xchg`.
`InterlockedExchange` is the first interlocked operation that reports
the
previous value. It takes that value through an `original_value`
reference
parameter, so this PR adds a `RequiresOriginalValue` flag to
`HLSLBuiltinTypeDeclBuilder` and a matching overload shape to
`HLSLExternalSemaSource`. The later compare operations reuse both.
The float overload of `InterlockedExchange` follows in a separate PR in
this
stack. This PR covers the integer overloads alone, so it links
https://github.com/llvm/llvm-project/issues/99129 without closing it.
Assisted by: Github Copilot
AArch64: Mark the LR def of GlobalISel calls dead
In SelectionDAG InstrEmitter would have marked this dead.
Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
[docs] Require MyST for Sphinx documentation builds (#223829)
Fedora plans to use the separate llvm_man_pages package that we build as part of our release process now:
https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840/37
I'm assuming that other distributions are either going to be able to
install the necessary Python modules that we depend on (myst_parser
etc), or will use this man page package if they need it. Therefore, I think we
can remove this enum and associated complexity.
Assisted-by: codex
[mlir][bufferization] Relax happens-before analysis (#223777)
On unstructured control-flow, the one-shot analysis is rather
conservative in regards to computing RaW conflicts, requiring strict
dominance which may not always be satisfied.
Relax this requirement to allow more cases to not be marked as
conflicting. Notably, readers/writers within a region that contains a
"diamond" or multiple loops are now handled.
This is a simpler version of
https://github.com/llvm/llvm-project/pull/223006 without the CFGLoopInfo
analysis, meaning it is a bit more conservative when analyzing regions
with nested loops.