[MergeFunc] Fix poison flag merging for varargs functions (#223347)
This is a followup to https://github.com/llvm/llvm-project/pull/220015.
writeThunkOrAliasIfNeeded() has an early exit for the case where none of
erase/thunk/alias apply, and we failed to merge the poison flags in that
case. I've opted to fix this by moving the annotation merging logic out
of writeThunkOrAliasIfNeeded() entirely, because I don't think it
logically fits there (it's not related to thunk/alias creation at all).
This is the minimal fix to address the miscompile. There is a potential
larger change we could make here, which is to avoid "merging" the
functions in this case in the first place. We don't actually merge the
functions here, but just rewrite all uses to one of them. This seems
kind of dubious to me, though I could see an argument that this can
still be beneficial in conjunction with --gc-sections (i.e. linker-level
dead function elimination).
clang: Distinguish unspecified from disabled exception model
Add ExceptionHandlingKind::Default so clang can tell an unspecified
exception model from an explicit -exception-model=none.
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>
[NFC][CrossDSOCFI] Move findCfiTypeIds to LowerTypeTests (#223582)
Move 64-bit numeric type identifier collection logic and
extractNumericTypeId
from CrossDSOCFI.cpp into LowerTypeTests.cpp, exposing it as
lowertypetests::findCfiTypeIds in llvm/Transforms/IPO/LowerTypeTests.h.
Encapsulate Cross-DSO CFI type ID discovery so CrossDSOCFI no longer
directly parses cfi.functions metadata.
PR Stack:
* https://github.com/llvm/llvm-project/pull/223581
* ➤ https://github.com/llvm/llvm-project/pull/223582
Assisted-by: Gemini
[RISCV] Improve the earlyclobber constraint for vector index load. (#223565)
When the data EEW is smaller than the index EEW, the destination may
overlap the index operand as long as the overlap is in the
lowest-numbered part of the index register group. If the index EMUL is
no larger than 1 then both operands are a single register, so any
overlap is necessarily the lowest-numbered part and no constraint is
needed.
Assisted-by: Claude
[NFC][LowerTypeTests] Move CFI metadata creation and helpers to LowerTypeTests (#223581)
Move enum CfiFunctionLinkage from llvm/Analysis/TypeMetadataUtils.h into
llvm/Transforms/IPO/LowerTypeTests.h (in namespace lowertypetests).
Move hasTypeMetadata and findCfiFunctions from ThinLTOBitcodeWriter into
LowerTypeTests.
Encapsulate cfi.functions, aliases, and symvers metadata creation into
lowertypetests::createCfiMetadata in LowerTypeTests.cpp, removing the
manual metadata generation from ThinLTOBitcodeWriter.
PR Stack:
* ➤ https://github.com/llvm/llvm-project/pull/223581
* https://github.com/llvm/llvm-project/pull/223582
Assisted-by: Gemini
[NVPTX] Add default value to collector_b ImmArg in tcgen05.mma intrinsics (#220237)
This patch adds default value for the `collector_b` flag in
`tcgen05.mma` intrinsics.
Also adds lit tests to verify that calls without explicit `collector_b`
operands correctly materialized with default value.
---------
Signed-off-by: DharuniRAcharya <dharunira at nvidia.com>
[docs] Use intersphinx for LLVM cross-project links
Configure the LLVM documentation with the external project inventories it
references and replace absolute cross-project documentation URLs with
validated intersphinx document and reference roles.
Part of #214861
[docs] Check absolute cross-project documentation links
Extend the absolute documentation link check to recognize documents from
configured intersphinx inventories. Diagnose absolute links to those documents
so authors use validated, project-qualified intersphinx roles instead.
Part of #214861
[docs] Use intersphinx for Clang cross-project links
Configure the Clang documentation with the external project inventories it
references and replace absolute cross-project documentation URLs with
validated intersphinx document and reference roles.
Part of #214861
[docs] Enable absolute documentation link checks
Configure the LLVM and Clang documentation URL prefixes so their Sphinx
builds reject absolute links to documents in the same project or a configured
intersphinx project.
Part of #214861
[docs] Repair stale LLVM documentation links
Use the Sphinx ref role for the IR2Vec section label so clean Sphinx
builds resolve it correctly. Remove the dangling BuildingAJIT Chapter 5
navigation text because that chapter no longer exists.
Fixes follow-up issues in #222506.
[docs] Replace llvm.org/docs links with project links
Use Sphinx document and reference roles or project-relative links for
links within the LLVM documentation. This lets Sphinx validate the
targets and keeps local documentation builds and archived release
documentation self-contained.
Part of #214861
[docs] Repair Clang documentation cross-references
Restore a stable target for the OSObject retain-behavior attributes and
reference it with the Sphinx ref role. Mark links to the generated AST
matcher reference as external so MyST preserves their project-relative
HTML destinations instead of treating the file as a download.
Fixes follow-up issues in #222507.
[docs] Replace clang.llvm.org/docs links with Sphinx links
Use Sphinx document and option roles or project-relative links for links
within the Clang documentation. Repair stale generated-document
fragments found while validating the replacements. This ensures that
standalone documentation builds are self-contained, although
cross-project links (Clang->LLVM) typically go via absolute llvm.org
hrefs.
Part of #214861
Assisted-by: Codex