[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.
[InstCombine] Fold variable extract of a constant-strided pointer vector (#217078)
A vector built from pointers that all point into the same object at a
constant stride is a table of addresses, so a variable extract from it
is address arithmetic:
%v0 = insertelement <4 x ptr> poison, ptr %b, i64 0
%v1 = insertelement <4 x ptr> %v0, ptr %b + 8, i64 1
%v2 = insertelement <4 x ptr> %v1, ptr %b + 16, i64 2
%v3 = insertelement <4 x ptr> %v2, ptr %b + 24, i64 3
%r = extractelement <4 x ptr> %v3, i32 %i
-->
%r = getelementptr i8, ptr %b, i64 %i * 8
Fold it to a single GEP. Every element must be reachable from one base
pointer at a constant byte offset, every lane of the vector must be
defined, and the offsets must form an arithmetic sequence; otherwise the
pattern is left alone.
[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.
[lld][MachO] Remove `__thread_ptrs` section so TLV can relocate against dynamic-lookup symbols (#221364)
lld/MachO rejects a relocation whenever `hasAttr(TLV) != sym->isTlv()`, but
`isTlv()` cannot separate "not thread-local" from "unknown", so that one
inequality rejects three unrelated cases and only one of them is ill-formed.
C++20 `constinit` made another of them common: it lets the compiler elide the
thread-local wrapper and access a cross-TU object directly ([folly 2c666105](https://github.com/facebook/folly/commit/2c666105e9a694aef7290cce3da14ed1ebf14462)),
producing a TLV relocation against a dynamic-lookup symbol. The check was also
masking a defect — `Symbol::gotIndex` is one field indexing whichever of `__got`
or `__thread_ptrs` holds the symbol — and never enforced it anyway, since
`UnwindInfoSection` and the stub paths call `in.got->addEntry` directly, so a
thread-local personality already collided on stock lld.
Both pools hold the same value, the descriptor's address, and ld-prime never
synthesizes `__thread_ptrs` at all. Make `__got` the sole non-lazy pointer
section, deleting `TlvPointerSection`, `NonLazyPointerSectionBase`,
`in.tlvPointers`, `Symbol::getTlvVA` and the indirect-symbol-table
special-casing, and collapsing `resolveGotVA`/`resolveTlvVA` into
`resolveNonLazyPtrVA`. One section, one index, so the collision becomes
[9 lines not shown]
Merge tag 'landlock-7.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux
Pull Landlock fixes from Mickaël Salaün:
"This mainly fixes the Landlock tracepoint support merged this cycle so
that denial and rule events report the intended policy context,
whether through tracefs or BTF-visible callbacks.
The size of this all is mainly from propagating the corrected contract
through event definitions and producers, adding new tests for the
reported context, and updating the documentation.
Also improve annotation and fix a GCC 16 build warning"
* tag 'landlock-7.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux:
landlock: Widen ruleset versions to 64 bits
landlock: Add counted_by in landlock_domain
landlock: Fix tracepoint contract documentation
selftests/landlock: Test network denial context
selftests/landlock: Test filesystem denial blockers
[7 lines not shown]
x11/cde-devel: Add newly required pkgconf build dependency
Add a pkgconf build requirement. While at it also document an autoconf
and autoconf-archive requirement.
Fixes: e4db654d831a
x11/cde-devel: Add newly required pkgconf build dependency
Add a pkgconf build requirement. While at it also document an autoconf
and autoconf-archive requirement.
Fixes: e4db654d831a
[VPlan] Compute execution probability via APFloat for printing. (#226135)
Similar to #201824 (8e517e1d17b1), use APFloat to compute the execution
probability. This ensures the output is independent of the underlying
libc/OS/architecture.
Suggested in https://github.com/llvm/llvm-project/pull/203982.
[SLP][NFC] Use BoUpSLP::getNumberOfParts() where appropriate (#225995)
Caches the results for better performance rather than directly calling
slpvectorizer::getNumberOrParts().
Small improvement in compile time.
[SPIRV] Support structurizing nested break chains (#222459)
This PR updates the SPIRVStructurizer to handle nested break chains.
This pattern occurs when switch statements are lowered instead as branch
instructions and break statements need to exit out to an outer
containing block.
This is a required change to support #112056.
Assisted-by: GitHub Copilot
[Flang][OpenMP][MLIR] Attach source location to target/target-data runtime c… (#222389)
…alls
This commit adds ident info to the OpenMP target call so the runtime now
reports the kernels source location in -g and non -g builds
Of note this does diverge from clang where the file info is only
provided with `-g` builds, however similar work is done in
`createMappingInformation` in
`mlir/lib/Target/LLVMIR/Dialect/OpenMPCommon.cpp`.
AMDGPU: Mark the SCC def dead when expanding CF pseudos
The control flow pseudos start with dead flags on the implicit scc def,
but did not transfer to the replacement instruction
Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>