[flang][debug] Scope re-associated names per construct branch. (#239668)
Fixes https://github.com/llvm/llvm-project/issues/159596
SELECT RANK and SELECT TYPE associate the selector with a different
entity in each of their branches, so a procedure holding one ends up
with several declarations of the same name, differing in type. They were
all attributed to the procedure, leaving a debugger to answer for that
name with whichever declaration it found first, which is right in at
most one branch:
select rank(x) ! x is integer(..)
rank(2) ; y = rank(x) ! `ptype x` said rank 1, `print x` agreed
Each branch starts a block of its own, so give that block a lexical
block and put the declaration of the branch in it. The lexical block
covers the blocks this one dominates, so it holds all the code of the
branch even when that spans several blocks, and the lexical block of a
construct nested in the branch nests in it.
[21 lines not shown]
[LV] Move createInterleaveGroups before removeBranchOnConst. nfc (#243789)
This is split off from #213904 to prepare for deciding scalar epilogue
requirement based on which interleave groups are actually widened.
[mlir][SCF] Preserve reductions in collapseParallelLoops (#244260)
collapseParallelLoops dropped the original scf.reduce and erased the
loop, so a parallel loop with reductions could not be collapsed and the
caller had no operation on which to set discardable attributes. Pass the
original init values through, keep the original scf.reduce with the
body, replace the old loop through the rewriter, and return the
collapsed loop.
[AMDGPU] Fold fmul with zero checks to fmul.legacy
Recognize f32 multiplication with zero checks in AMDGPUCodeGenPrepare,
including fabs/fneg wrappers.
Example:
```
(x == 0 || y == 0) ? +0.0 : x * y
==>
llvm.amdgcn.fmul.legacy(x, y)
```
[AMDGPU] Add fmul.legacy select fold tests. NFC (#229356)
Add AMDGPUCodeGenPrepare tests for folding a select guarded by zero
checks into llvm.amdgcn.fmul.legacy, including negative tests and min
cases for future work.
Assisted-by: Claude Opus 5.5
[analyzer] Remove GDM entries instead of storing null (#244845)
ProgramStateManager::addGDM stored {Key: nullptr} when a trait became
empty, e.g. after removing the last element of a map/set, or after
setting a scalar or pointer trait to 0/nullptr (ExprEngine does this
with LastEagerlyAssumeExprIfSuccessful on every eager assume). Every
trait reads a null entry the same way as an absent one, so these states
had identical contents but a different GDM, and were uniqued as distinct
ProgramStates. Paths that should have merged in the ExplodedGraph did
not.
Remove the key when the new value is null, so that "absent" and "empty"
have one canonical representation.
On some LLVM TUs (GVN, LiveVariables, RegionStore) the analyzer now
executes 0.8-4.2% fewer steps and explores 3-24% fewer paths. On those
TUs and SemaExpr this reduces the instructions of the static analyzer by
0.8-2.6% and the cycles by 1.4-3.1%. Peak memory is unchanged except
LiveVariables (-4.8%). The diagnostics are unchanged.
[3 lines not shown]
[analyzer][ADT] Filter the Environment instead of rebuilding it (#244771)
EnvironmentManager::removeDeadBindings rebuilt the Environment by adding
each live binding to an empty map. This allocated a whole new tree on
every call, and made the canonicalization hash and compare it in full.
Add ImmutableMap::Factory::filter, which keeps the subtrees whose
entries all survive and rebuilds only the paths to removed entries. Like
add and remove, it canonicalizes only the result root. Use it to remove
the dead bindings.
On some LLVM TUs this reduces the instructions of the static analyzer
by 8-13%, the cycles by 5-10%, and the peak memory by 7-15%.
Assisted-by: Claude Opus 5.5
---------
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[analyzer] Drop the unused FoldingSetNode base of EquivalenceClass (#244866)
EquivalenceClass derived from FoldingSetNode but was never put in a
FoldingSet; its Profile method is all ImmutableMap/Set need. Drop the
base. This shrinks it from 16 to 8 bytes on 64-bit targets, and the
ClassMap, ClassMembers, ConstraintRange and DisequalityMap nodes from 80
to 72 bytes and the ClassSet nodes from 72 to 64 bytes.
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
cq-cli: update to 0.20.1
cli/v0.20.1
* build: re-pin the Go postgres adapter to the published SDK v0.18.0
* fix(sdk/go): reject a sqlite store URL that carries a host
* fix(sdk/python)!: resolve a sqlite store URL through its components
* fix(sdk): point the own-knowledge calls at the agent surface
* build: re-pin the CLI and the Go postgres adapter to the published SDK
cli/v0.20.0
* fix(ci): replace existing assets when the CLI release upload re-runs
* build: require cq-sdk 0.21.2
* fix(sdk/go): keep the drive letter in a sqlite store URL on Windows
* test(server): cover the schema free-text ceilings at the propose boundary
* fix(mcp): state the propose field limits in the tool description
* feat: add list for an agent's own knowledge units
* build: re-pin the CLI to the published Go SDK v0.18.0
[37 lines not shown]
[lldb][NativePDB] Don't turn function-local enums into scoped enums (#244640)
CodeView can't tell a scoped enum from an unscoped enum.
`EnumRecord::isScoped()` was the wrong check: it does not say whether
the enum is an `enum class`. Instead, it says if the type is declared
inside the body of a function.
This patch always creates unscoped enums and adds a new test which fails
without the change.
rdar://192360576
[clang][AST] Dump saved APValue of all `VarDecl`s (#239672)
Only evaluate the value of constexpr variables during `dump()`, but
always print the saved `APValue` if there is one.
This is more honest since we don't withhold the values we calculated for
non-constexpr variables.
[lldb][Windows] Restore blocking mode of sockets polled by MainLoopWindows (#243851)
`MainLoopWindows` polls sockets with `WSAEventSelect`, which makes them
non-blocking, and `DidPoll` never restores blocking mode.
This patch restores blocking mode in `DidPoll`, after clearing the event
selection.
Under load, at desk, `SocketTest.CreatePair` fails 49 of 6000 runs
without this patch and passes 8000 of 8000 with it. The new
`MainLoopTest.PolledSocketStaysBlocking` fails every run without it.
rdar://191149178
[OpenMP] Don't emit explicit flushes for atomic constructs
Clang and the OpenMPIRBuilder followed every atomic construct that has a
memory ordering other than relaxed with a call to __kmpc_flush, which is
a full memory barrier. However the LLVM LangRef specifies that an atomic
operation itself can provide the ordering "rather than an explicit fence",
so this isn't actually necessary.
It seems the calls are emitted based on a reading of the spec describing
*implied* flushes to mean that flushes should be literally emitted;
an alternative reading (here) is that the flushes are implied by the
atomic operation itself. See e.g. OpenMP 6.0 "17.8.5 atomic Construct"
or equivalent passages in 5.0 through 5.2. The flushes in question
are the "with a list" type for seq_cst, i.e. relating only to the
memory locations used in the atomic. For acquire/release atomics,
synchronization happens through the atomic's variable.
The __kmpc_flush call was also only emitted after the atomic operation,
so in some cases we're *already* relying on the ordering provided by
[29 lines not shown]
[SPIR-V] Rebuild multi-register aggregate arms from a typed placeholder (#236369)
`insertCompositeAggregateArms` rebuilds a multi-register aggregate arm
(e.g. the result of `llvm.sincos`) of an aggregate select or PHI with
`insertvalue`, starting from `poison`. It runs after
`preprocessUndefsAndPoisons`, so that poison stayed bare and
`visitInsertValueInst` turned it into `UndefValue::get(i32)`, which is
uniqued: a second such chain in the function, or any `i32 undef`, then
got the first chain's SPIR-V type, giving an invalid
`OpCompositeInsert`. The chain now starts from the placeholder
`preprocessUndefsAndPoisons` would have created.
Assisted-by: Claude Opus 5.5
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SPIRV] Fold constant byte offsets past an array element into the index (#243461)
Logical SPIR-V asserts in `walkLogicalAccessChainConstant` when a GEP
adds a constant byte offset to a pointer into a byte-addressed array and
the offset reaches past the element. For example, InstCombine turns
`color.data[o + 2]` on `float4 data[8]` into `getelementptr [16 x i8],
%base, i32 %o` followed by `getelementptr i8, %p, i32 32`. The access
chain walk deduces `<4 x float>` for `%p` and cannot apply a 32-byte
offset to it.
This splits offsets like this into a count of array elements, which it
adds to the array index, and the leftover bytes, which stay a byte
offset inside the new element. In the example, `color.data[o]` plus 32
bytes becomes `color.data[o + 2]`. Longer GEP chains and variable
offsets still fail.
Addresses the constant-byte-offset crash in #206815.
RuntimeLibcalls: Add attributes to fenv libcalls (#244446)
Treat the fp environment as inaccessible memory.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
NAS-145368 / 27.1.0 / Clear the login rate limit in the password expiry unit tests (by bmeagherix) (#20283)
auth.login_ex over TCP is limited to 20 calls per minute per IP, and
logins made by earlier tests in the run count against that limit.
test__password_expired and test__password_expiry_warning could then fail
with EBUSY "Rate Limit Exceeded" depending on test order and timing.
Clear the rate limit cache before these two tests only.
Original PR: https://github.com/truenas/middleware/pull/20281
Co-authored-by: Brian Meagher <brian.meagher at truenas.com>
NAS-145368 / 28.0.0-BETA.1 / Clear the login rate limit in the password expiry unit tests (#20281)
auth.login_ex over TCP is limited to 20 calls per minute per IP, and
logins made by earlier tests in the run count against that limit.
test__password_expired and test__password_expiry_warning could then fail
with EBUSY "Rate Limit Exceeded" depending on test order and timing.
Clear the rate limit cache before these two tests only.