[FlowSensitive] add handling for AssertionResultExpectation (#229273)
In a follow up, this will be used by the StatusOr and Optional models.
Assisted-By: Gemini
[AMDGPU][SROA] Expand cast chain handling to floating point types
CreateBitPreservingCastChain does not produce inttoptr or ptrtoint for floating-point types. When promoting structs like { float, float } to <2 x float>, this can lead to pointers being bitcast directory to <2 x float> which is invalid. This change expands the use of the intermediate to these cases
[flang][Semantics] Enforce F2023 C1545 only for generic references (#219581)
F2023 C1545 requires the consequent-args of a conditional argument to
agree on corank and on the ALLOCATABLE and POINTER attributes, but only
in a reference to a generic procedure. Flang applied the constraint to
every reference containing a conditional argument and rejected
conforming
code.
Move the cross-consequent checks out of CheckConditionalArg() and run
them from CheckAndResolveGenericReference(), before ResolveGeneric()
and only when the reference is generic. C1545 is a constraint, not one
of the generic resolution rules in F2023 15.5.5, so check it separately
from candidate matching.
When C1545 fails, return a GenericResolution with errorReported set
without calling ResolveGeneric(). The callers stop analyzing the
reference without additional generic-resolution diagnostics.
GetCalleeAndArguments() also returns before fallback intrinsic probing.
[26 lines not shown]
AMDGPU/GlobalISel: Split 4-byte aligned 64-bit LDS accesses on SI
SI cannot use ds_read2_b32/ds_write2_b32 for 4-byte aligned 64-bit
accesses due to the LDS bounds checking bug with negative base
addresses, and the selection patterns for them require
HasUsableDSOffset. The explicit legality rules still treated these as
legal, so they failed to select. Split them into 32-bit accesses as
SelectionDAG does, and enable the GFX6 run lines in the local load and
store tests.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[flang][OpenMP] Switch clause verification to descriptor-based
Delete all the scattered pieces of clause verification that are now
replaced by the unified handling.
[flang][OpenMP] Improve diagnostics about modifier properties
Use OpenMPDeprecated and OpenMPFuture warning categories for modifier
diagnostics as well, analogously to how they are used for clauses.
[flang][OpenMP] Account for using different versions for modifier checks
When a modifier from a past/future version is accepted, use its properties
from the nearest version in which it is allowed.
RegisterCoalescer: Restore subrange PHI inputs of pruned undef values
When joining erases an IMPLICIT_DEF or a copy, the liveness of undefined
lanes may have started at that instruction, so pruneSubRegValues removes
those subrange values. If such a value was live-out into a subrange PHI,
the PHI is left without an input from that predecessor, even though
after the join the lane value from the earlier def of the joined
register reaches it. The main range does not have this gap because
pruneValues collects the pruned end points and joinVirtRegs restores
them with extendToIndices.
Record the PHI kills of the pruned value, the predecessor block ends
where it is live-out into a PHI as in LiveIntervals::hasPHIKill, and
restore them with extendToIndices once operands are rewritten, together
with the existing subrange shrinking. The rewrite is needed so
computeSubRangeUndefs sees the defs of both registers. Only PHI kills are
restored; the in-block kills of a pruned value are reads of an undef
lane and get undef flags instead.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang] Don't add built-in operator candidates that can't be viable (#227584)
If an operand of an operator has (or converts to) an arithmetic or
enumeration type, AddBuiltinOperatorCandidates() adds a built-in
candidate for every pair of promoted arithmetic types, and each
candidate tries to convert both operands. That's 121 candidates for `a
== b` on arm64 macOS.
If an operand can't convert to any of these types, none of these
candidates are viable (e.g. `e == E::kFoo` for a scoped enumeration E).
So conservatively track if each operand can convert to an arithmetic
type, and only add these candidates if all operands can convert.
Non-viable built-in candidates aren't used for anything and are safe to
not add.
For 60 random Chromium TUs (linux x64, -O2) picked with probability
proportional to their compile time, sum over all TUs:
CPU time: 186.6 s => 183.3 s, -1.81%
[8 lines not shown]
[lldb] Add StringPool and per-debugger and system pool handles (NFC) (#228611)
Move the ConstString pool into a StringPool class and add a non-owning
StringPoolRef handle. This is in preparation for having one global and
multiple per-Debugger ConstString pool. Strings at the SB API layer will
be interned into the appropriate pool. As long as these remain
references, this operation is a NOOP.
[SPIRV] Splat scalar condition for vector OpSelect prior to SPIR-V 1.4 (#229267)
Before SPIR-V 1.4, the Condition operand of an OpSelect instruction with
a vector Result Type must be a vector of Booleans with the same number
of components as the result vector. LLVM IR allows a scalar i1 condition
when selecting between vectors, which causes spirv-val to reject the
module on SPIR-V 1.0 through 1.3 targets.
When targeting SPIR-V versions below 1.4, splat a scalar boolean
condition into a matching boolean vector via OpCompositeConstruct before
emitting OpSelect.
[NewPM] Properly initialize NewPM reg-bank-select (#229534)
The NewPM initialization of the pass didn't call computeOptMode as the
legacy one does. Missed in porting:
https://github.com/llvm/llvm-project/pull/217756
[clang] Fix handling of invalid nonnull attribute arguments (#229519)
The nonnull attribute accepts a variadic list of indexes to function
pointer parameters, specifying which ones are not allowed to take a null
value. If an index is invalid (e.g. the referenced function parameter is
not a pointer), then the index is dropped from the semantic attribute
retained in the AST.
Previously, if all the specified indicies were invalid, Clang would
associate a semantic nonnull attribute with no arguments on the
FunctionDecl, which would cause all pointer arguments to be treated as
nonnull. Now, if there are no valid indicies specified, the attribute is
dropped entirely and so no pointer arguments are treated as nonnull.
Fixes #228670
[mlir] Migrate AMDGPU/ROCDL to targets, not chipset versions
**migration tl;dr:** Replace usages of `amdgpu::Chipset` with `ROCDL::TargetInfo`, ideally move from `chipset=` to `arch=`. If you don't use upstream pipelines, call 'TargetInfo::migrateArchFeaturesToModuleFlags` at the appropriate location.
Further note: if you've got a build pipeline that's getting a `gfxXXX` name from something like `rocm_agent_enumerator`, using a full triple name like the ones you get from `rocminfo` is preferred.
`amdgpu::Chipset` was an awkward hack that was hard to keep up to date
with changes in the compiler/new architectures, and didn't properly
support generic targets (and has been strongly disfavored by the
compiler team).
This PR replaces `amdgpu::Chipset` with `ROCDL::TargetInfo`, a
structure that uses LLVM's TargetParser and the underlying LLVM
features tables to get the real nature of the target being compiled
for.
This also helps MLIR move to
new-style (`-mtriple=amdgpuX.YZ-amd-amdhsa`) over "old
style" (`-mtriple=amdgcn-amd-amdhsa -mcpu=gfxXYZ`) triples.
[36 lines not shown]
AMDGPU: Select region address space loads and stores (#229500)
Fix the annoying asymmetry where we handle local and region for some
atomics but not the full suite of operations. I run into this about once per
year and want to be done with it.
The ugly bits here are to deal with the fact that it appears m0 still requires
initialization in gfx9+. It was simpler to handle the true16 case by
preprocessing the selection to a 32-bit extload as the load truly is, and go
through the ordinary m0 gluing.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[flang][OpenMP] Switch clause verification to descriptor-based
Delete all the scattered pieces of clause verification that are now
replaced by the unified handling.