SystemZ: Avoid using operand parent in AssociatedDataAreaTable::insert (#220054)
Take the MachineFunction directly to reach the target and context
instead of recovering it through the operand's parent.
Co-authored-by: Claude (Claude-Opus-4.8)
Hexagon: Fix early if-conversion crash on an undef PHI operand (#216815)
Found by AI while working on something else.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[AMDGPU] Add getVGPRAllocGranule to TargetParser
Add getVGPRAllocGranule(GPUKind) and getVGPRAllocGranule(SubArchType) so
the VGPR allocation granule can be queried from a GPU name alone, without
an MCSubtargetInfo. This is to aid in resolving
https://github.com/ROCm/llvm-project/issues/3298 : "Comgr should use
target information from upstream TargetParser rather than maintaining
its own".
The wavefront size is a per-kernel mode rather than a property of the
GPU, so it stays an explicit parameter. IsaInfo::getVGPRAllocGranule
keeps its signature and now forwards to the new entry point, leaving the
dynamic VGPR block size - which is likewise not a GPU property - in the
backend. There is no functional change.
Change-Id: I85900e505b3fe6eb837e178cc3f474fe14dcba47
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
[libc++] Make once_flag pointer-sized on MinGW (#219895)
This is ABI breaking on MinGW. However, the impact is deemed small
enough that it's acceptable.
[AMDGPU] Expose 1536-physical-vgprs to the TargetParser
Add Feature1536VGPRs to AMDGPUFrontendVisibleFeatures so the per-GPU
feature bitset carries FEAT_1536_PHYSICAL_VGPRS, and list it in
FrontendOnlyFeatures so it is not serialized into the target-feature
string. This is a prerequisite for querying the VGPR allocation granule
from the TargetParser; there is no functional change.
Change-Id: Icdff14fbe3a734e49f8fe3d933eceb11def686ec
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
Revert "[SSAF][clang-reforge] Add end-to-end clang-reforge tests (#219085)" (#220049)
This reverts commit b043e590cf490d671ba9377ac11fb6b1e52625be.
The added test in clang relies on clang-tools-extra, breaking clang
tests.
[dsymutil] Update test after docs md renaming (#220060)
The PR #219624 renamed the documentation file which was referenced in
the test. Update the test so it passes.
[AMDGPU] Expose 1536-physical-vgprs to the TargetParser
Add Feature1536VGPRs to AMDGPUFrontendVisibleFeatures so the per-GPU
feature bitset carries FEAT_1536_PHYSICAL_VGPRS, and list it in
FrontendOnlyFeatures so it is not serialized into the target-feature
string. This is a prerequisite for querying the VGPR allocation granule
from the TargetParser; there is no functional change.
Change-Id: Icdff14fbe3a734e49f8fe3d933eceb11def686ec
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
gstat: Set errno = 0 before strtoul
The strtoul function sets errno on error, but does not clear it on
success; when using strtoul and checking errno (as one should) for
ERANGE / EINVAL afterwards, it's important to zero errno first.
While here, remove a dead store.
Reviewed by: phk
Fixes: 4fe8c1b67be0 ("Add error and range checking ... ")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59270
[libc] Clean up some unused includes (#220038)
The `CMakeLists.txt` for these already reflect the correct dependencies
(e.g. `libc/startup/linux/x86_64/tls.cpp` depends on
`libc.config.app_h`, not `do_start`). I was adding some Bazel rules for
libc entrypoints and saw these unused deps.
[libc] Correct hidden attribute on __restore_rt (#220039)
This PR fixes the syntax for a `hidden` attribute in `__restore_rt`.
When compiling with `-Wattributes`, this TU complains about:
```
llvm-project/libc/src/signal/linux/__restore.cpp:20:67: error: unknown attribute 'hidden' ignored [-Werror,-Wunknown-attributes]
20 | extern "C" void __restore_rt() __attribute__((no_sanitize("all"), hidden));
```
[libc][exit] Use LIBC_CONSTINIT macro to allow pre-C++20 compilation (#220041)
The `constinit` specifier was added in these files before
`LIBC_CONSTINIT` was added to LLVM-libc. This PR updates the
`at_quick_exit` and `atexit` entrypoints so they may be compiled
pre-C++20.
Revert "[Test] Add missing dependency for llvm-ordergen (#219992)" (#220036)
This reverts commit ae35002188a5c483c3956f3d4a7f026368126655.
Sorry, this should not have gone upstream.
AArch64: Pass instruction to maybeKillChain (#219997)
Take the containing instruction directly instead of recovering it from
the operand's parent.
Co-authored-by: Claude (Claude-Opus-4.8)
[SandboxVec][BundleVec] Fix crash when seed size < 2 (#219556)
This fixes an assertion crash when the input seed vector provided to
BundleVec contains less than 2 entries. This can happen when the seeds
get vectorized by a pass running between the seed collection and the
invocation of BundleVec.
[docs] Convert first batch of CommandGuide docs to Markdown (#219625)
This change migrates half the CommandGuide rst files. Originally, we
were going to leave man pages out of scope, since migrating to markdown
there means that building man page docs requires an additional
dependency (myst-parser). However, Fedora at least is now grabbing the
generated groff file artifacts from our releases
([link](https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840/37?u=rnk)),
and I suspect other distros will be able to migrate to this model, or
install the necessary build dependency. The extra dependency is mostly a
concern for distros with long LTS timelines.
I reviewed the before and after, and I noticed *lots* of blockquoting
artifacts from extra indentation in the rst original. This was invisible
prior to the furo migration, but the new furo theme makes it very
visible, you can see if in the before/after pages, in particular in
lit.md.
Tracking issue: #201242
[7 lines not shown]
[docs] Rename first batch of CommandGuide docs to Markdown (#219624)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
SystemZ: Avoid using operand parent in AssociatedDataAreaTable::insert
Take the MachineFunction directly to reach the target and context
instead of recovering it through the operand's parent.
Co-authored-by: Claude (Claude-Opus-4.8)
clang: Emit "exception-model" module flag
Record the exception-handling model as an "exception-model" IR module
flag when it differs from the target triple's default, mirroring how
other target ABI properties are recorded. Adds a
CodeGenOptions::toExceptionHandling helper to translate clang's
ExceptionHandlingKind into the LLVM ExceptionHandling enum.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
IR: Introduce "exception-model" module flag
Add an "exception-model" IR module flag intended to replace
TargetOptions::ExceptionModel, such that the ABI is fully
computable from the IR alone. Add the basic documentation and
verifier/linker tests, but doesn't wire up the consumers.
The main thing I question is whether the single "wasm" model is
really the correct control. With the existing TargetOption,
WebAssembly is overloading "none" in a weird way that sometimes
means default, and sometimes mean forcibly disabled exceptions.
It additionally has -wasm-enable-eh and -wasm-enable-sjlj cl::opts
and I don't fully understand the interaction between all of these
knobs; the cl::opts are even worse than the TargetOptions since
these still change the ABI and are backend private.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[flang][cuda] Fix device-to-device transfers involving scalar CUDA constants (#219577)
Scalar CUDA constants are designated by a host shadow global, so they
cannot be an operand of a device-to-device copy. Route such transfers
through the shadow instead of passing host pointers to a
cudaMemcpyDeviceToDevice.