lean4: handle rpaths in lean compiler/build system
Define C++ standard used, use CMake variables instead of manual
post-installation rule. Depend on required gmp version.
[lldb] Remove ConstString from FileSpec (#211394)
This commit completely removes ConstString from FileSpec, replacing it
with llvm::SmallString instead.
I considered combining the directory and the filename together into one
field, but then it became impossible to distinguish between a
partially-constructed FileSpec's last directory and a fully-constructed
FileSpec's filename.
The sizes of the SmallStrings are somewhat arbitrary. I tested out a few
other configurations on my machine locally and this yielded the best
memory/runtime tradeoffs.
I measured the impact of this change in two ways:
(1) Runtime performance
I measured the runtime impact by using LLDB's statistics with `stat
enable` and `stat dump -f` (forcing the parsing of symbols) for a debug
[15 lines not shown]
[Clang] Avoid querying tag definitions for invalid DeclSpecs (#210085)
Guard hasTagDefinition() against invalid type-specifier state so
recovery from invalid auto/tag combinations does not assert.
Fixes #210014
---------
Signed-off-by: Osama Abdelkader <osama.abdelkader at gmail.com>
[IR] Make semantics of strictfp consistent v2 (#211769)
Changes: The patch was originally landed as af0c933e (#209465), but
there was an issue with strictfp functions being inlined into
non-strictfp functions. The issue has since been resolved by a2b42b10a
([IR] Reject inlining strictfp alwaysinline callee into non-strictfp
caller, #210701) and the re-land is identical.
Although the section on constrainedfp in the LangRef clearly states "All
function definitions that use constrained floating point intrinsics must
have the strictfp attribute", indicating that a function with strictfp
calls must be marked with strictfp, the general description of strictfp
does not specify this. Refine its semantics and make it so, eliminating
the inconsistency.
[VPlan] Endow DerivedIV with IRFlags (#205908)
Endow DerivedIV with no-wrap flags that are used in all adds and muls:
the FP induction can still get the FastMathFlags from the FPBinOp. The
patch changes vputils::createScalarIVSteps where no-wrap flags are
applicable. GEP no-wrap flags are missing nearly everywhere, and is left
to an exercise for a follow-up.
Proof: https://alive2.llvm.org/ce/z/rHtwEH +
https://alive2.llvm.org/ce/z/h297HG for a larger UF on one test
AMDGPU: Reject unrecognized amdgpu subarch in TargetID parsing
A bare "amdgpu" or an unrecognized "amdgpu<x>" both parse to the
amdgpu arch with no subarch; TargetID::parse previously accepted them,
taking a named processor and ignoring the missing subarch.
Reject triples with no subarch, unless it uses the legacy spelling.
This is another workaround for Triple not having a proper unknown value
for subarches.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[lldb] Classify embedded formatter sections in WebAssembly objects (#211704)
A `section` attribute on a data variable is placed in a named data
segment on WebAssembly rather than a top-level custom section, so the
.lldbformatters and .lldbsummaries segments that carry embedded data
formatters were classified as plain data. The data-formatter loader
looks these up by section type, so embedded summaries and synthetic
child providers were never registered for a Wasm module.
Map the two formatter segment names to their section types when creating
sections, and place the segments in linear memory like other data so
their contents resolve. This mirrors the ELF and Mach-O object file
plugins.
Assisted-by: Claude
AMDGPU: Avoid dropping poison when extracting a high element
Haven't found a case where this matters, but I want to stop finding
this instance of the is-undef-get-undef pattern.
AMDGPU: Validate processor is consistent with subarch in TargetID parsing (#211828)
TargetID::parse checked that a named processor was a recognized GPU, but
not that it was consistent with the triple's subarch. A target id like
"amdgpu9.00-amd-amdhsa--gfx803" was accepted even though gfx803 does not
belong to the amdgpu9.00 subarch, silently taking the processor and
ignoring the mismatched subarch.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
AMDGPU: Don't pack a build_vector with an undef/poison lane
Once ISD::POISON is legal it reaches isel and is treated as canonical, so
is_canonicalized_2<build_vector> matched build_vector<x, poison> and selected
a v_pack for a don't-care high lane. Avoids regressions in future patches.
Co-authored-by: Claude (Claude-Opus-4.8)
clang/AMDGPU: Migrate cc1 tests to subarch triples (8)
Rewrite SemaHIP cc1 test RUN lines to the new subarch triple form,
dropping the redundant -target-cpu.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang/AMDGPU: Migrate cc1 tests to subarch triples (7)
Rewrite the remaining small test directories (CodeGenCXX, Misc, Sema,
SemaCUDA, SemaCXX) cc1 RUN lines to the new subarch triple form, dropping
the redundant -target-cpu.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang/AMDGPU: Migrate cc1 tests to subarch triples (6)
Rewrite CIR/CodeGenHIP cc1 test RUN lines to the new subarch triple form,
dropping the redundant -target-cpu, and regenerate autogenerated CHECK
lines.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang/AMDGPU: Migrate cc1 tests to subarch triples (5)
Rewrite OpenMP cc1 test RUN lines to the new subarch triple form,
dropping the redundant -target-cpu, and regenerate autogenerated CHECK
lines. Tests that intentionally assert the "target-cpu" attribute are
left unchanged.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[CIR][CUDA] Add support for NVVM ldu builtins (#211843)
Adds CIR codegen support for the NVVM global uniform load builtins
`nvvm_ldu_*` ,including the integer, floating-point, and vector
variants.
These are lowered to the corresponding `llvm.nvvm.ldu.global.*`
intrinsics based on the pointee type.
[flang] Fix host association for ASYNCHRONOUS/VOLATILE in submodules (#211669)
In `HandleAttributeStmt`, when an `ASYNCHRONOUS` or `VOLATILE` statement
names a variable not already in the current scope, flang creates a
host-association symbol — but only for `Subprogram` and `BlockConstruct`
scopes. Submodule scopes have kind `Module`, so the check excluded them.
This caused a fresh `EntityDetails` symbol (zero-initialized) to be
created instead of a `HostAssocDetails` symbol pointing at the ancestor
module variable, producing value 0 instead of the initialized value.
Fix: extend the condition to also fire when `currScope().IsSubmodule()`.
`Scope::FindSymbol` already traverses into the parent module for
submodules, so the host variable is found correctly.
Note: the `volatile`/`asynchronous` `fortran_attrs` are not propagated
to `hlfir.declare` for host-associated variables in general
(subprograms,
BLOCK constructs, and submodules); that is a separate lowering issue
tracked in #208588.
[3 lines not shown]
[flang][OpenACC] Don't rebind construct entities to enclosing variables (#210775)
`AccAttributeVisitor::Post(Name)` "adjusts" every name referenced inside
an OpenACC region to the symbol found in the current scope. A construct
entity -- a `DO CONCURRENT`/`FORALL` index-name, or a variable declared
in a `BLOCK` construct -- lives in its own scope nested within the
region, but the visitor's current scope does not descend into that
construct scope. `FindSymbol` therefore resolves the name to a
like-named variable in an enclosing scope and rebinds the reference to
it.
When such an entity shadows an enclosing DO variable and the loop is
associated with an OpenACC construct, this makes the entity alias that
active DO variable, so referencing or defining it wrongly triggers
"Cannot redefine DO variable" -- even though the code is legal and
compiles without error when OpenACC is disabled. This affected a `DO
CONCURRENT` index-name as well as a variable declared in a `BLOCK`
construct nested in the loop, e.g.:
[21 lines not shown]
uvideo: Return actual mtx_sleep error in dqbuf
Don't coerce errors to EINVAL, which isn't correct for mtx_sleep's
failure cases.
Sponsored by: The FreeBSD Foundation