[mlir][arith][llvm] Mark floordivsi/urem/srem as ConditionallySpeculatable (#235770)
These ops can trap (division/remainder by zero, and signed overflow for
the signed variants). They were incorrectly marked `Pure`, which allowed
LICM to hoist them out of loops that may execute zero times.
This change makes them `ConditionallySpeculatable`, following the same
pattern already used by `divsi`/`remsi` and `udiv`/`sdiv`.
Fixes #233213
Related discussion:
https://discourse.llvm.org/t/ub-op-semantics-of-arith-integer-division-remainder/92558
---------
Co-authored-by: Matthias Springer <me at matthiasspringer.de>
[SPIRV] Emit NSDI opcode DebugTypeEnum (#234752)
This makes `SPIRVNonSemanticDebugHandler` emit
[`DebugTypeEnum`](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugTypeEnum)
for a `DICompositeType` tagged `DW_TAG_enumeration_type`, with one Value
and Name pair per `DIEnumerator`. Each CU lists its file-scope enums in
`enums:`. Each of those enums takes that compile unit as its Parent.
Three operands need special handling:
1. Underlying Type: an enum declared without a type, such as `enum E { A
}`, defaults to `int`, so this emits `int` rather than `DebugInfoNone`.
2. Size must be an `OpConstant`, so an incomplete enum, whose size is
recorded as 0, is dropped.
3. Each Value is a 32-bit integer `OpConstant`. If an enumerator needs
more bits, we leave it out.
This does not handle cycles, such as a struct with a member of an enum
declared inside it. [PR
[10 lines not shown]
databases/mongodb80: fix build with llvm21
* The change is backported from boost 1.92
* Skip installing install-compass. There is no prebuilt compass
for FreeBSD
PR: 299438
Committed from: De kat in de Wijngaert
ng_pppoe: fix m_pullup() logic
The clear intent here is to do m_pullup() if we _don't_ have two bytes.
Before the fix: a) m_pullup() was always called and did nothing; b) if a
node was ever supplied with a fragmented but otherwise correct mbuf, then
it would not handle PROT_LCP as intended.
Noticed by: zlei
Reviewed by: zlei, eugen_grosbein.net
Differential Revision: https://reviews.freebsd.org/D60788
Fixes: 28903f396af4b151e16ea606cda66a9244fb179f
(cherry picked from commit 4c72b1c36dda72b9ba8de593cac2c94e15f42bcf)
[mlir][OpenMP] Diagnose non-loop-transformation uses of omp.new_cli (#235164)
The verifier assumed every user of the CLI implements
LoopTransformationInterface, so it asserted on other operations such as
func.call.
Replaced the cast with dyn_cast so the verifier emits an error pointing
at the invalid use instead, and added a test.
Fixes #234635
pf: Free the stack key when attaching it collides
pf_state_key_attach() attaches the wire key first and then the stack
key, setting sks to NULL before the second pass. When the stack key
collides with an existing state, the error path removes the wire key
again but then frees sks, which is NULL by then: the stack key leaks.
pfsync hits this. A peer that gets a plain state in a bulk update
before a redirected state whose stack key is the plain state's key
fails to import the redirected state, leaks its stack key, and leaks
another one with every later update of that state.
Free sk, the key of the pass that collided (skw on the wire pass), and
add a test.
Reviewed by: kp
Fixes: 371bd29d4b22 ("pf: fix potential state key leak")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60951
ipfw: declare the ipfw_nat64 module
The module declaration is necessary for 'kldstat -m' to see it,
and the rc(8) uses that to detect presence of ipfw_nat.
Submitted by: markj's Post-Commit LLM Review Service
Fixes: 9bcc1e97dda8e926483b81874884211bbe4f36e9
textproc/vss-text: Ada Unicode library
textproc/vss-text:
A high level Unicode text processing library, designed with the following
objectives:
* To introduce a definite type that represents a string of Unicode characters
and provides a handy set of operations.
* The API should be encoding independent and allows efficient implementations.
* Besides separating string API from in-memory data representation, it should
separate string API from input/output stream representation.
* To provide a clear, well-defined semantic for iteration over string elements,
such as Unicode unit, grapheme cluster, etc.
* To avoid string element integer indexes, because this isn't necessarily
constant time and could mislead about indexed element kind.
* To prefer safe results over raising exceptions where possible.
https://github.com/AdaCore/vss-text
PR: 296500
devel/gnatcoll-minimal: Update to 26.2
Update to 26.2:
* Reorganise pkg-plist so all GNATColl components will be rooted
in the one shared directory
* Makefile housekeeping
PR: 298389
[libcxx][test-support] Implement fancy_pointer_allocator (#196187)
In order to make sure that our further modifications of basic_string
will make it able to handle fancy pointers such as boost::ipc::offset_ptr,
we need some testable fancy pointers. Unfortunately, offset pointers
themselves are a bad idea for that, as they cannot be constant evaluated.
Instead, we are implementing a test fancy pointer that has nontrivial
special member functions that are C++20 constexpr and have side effects
that can be checked on correctness even in constant evaluated test contexts,
backed by a similarly C++20 constexpr fancy pointer allocator.
The idea is that the allocator has a state that counts how many pointer
instances originated from the allocator exist at the moment, the
pointers in their special methods update this shared state, and the
state checks at its destruction that there exactly 0 pointers are recorded
as still existing. The state is unique per instance of default-constructed
allocator but shared between the instances of copy/move-constructed
allocators.
[10 lines not shown]
feat(gisel): Mirror trunc/xor/select demanded bits
Extend scalar demanded-bits simplification to G_TRUNC, G_XOR, and
G_SELECT, following SelectionDAG traversal, known-bit propagation,
shared-use handling, and final folds. Honor GISel legality and target
profitability when rewriting or narrowing operations.
Share AArch64's logical-immediate search through a narrow XOR hook and
adapt XOR/shift profitability queries for both selectors. Preserve
SelectionDAG's constant-shrinking interface and node construction.
Share shift-amount validation in CodeGenCommonISel using templated
callbacks for selector-specific lane access and KnownBits queries.
Preserve recursive constant bypasses and use-specific rewrites of shared
producers. Recognize constants at the analysis depth limit, matching
SelectionDAG, and retain KnownBits-based bypasses as a fallback.
Keep G_ASHR of G_SEXT_INREG arithmetic unless the top C + BW - W bits are
[5 lines not shown]
[mlir] Preserve all analyses in reconcile-unrealized-casts when no casts (#236336)
This lets the pass manager skip the post pass verifier, visible on large
modules
Without casts the pass changes nothing, so re-verifying the whole module
is a waste of time
[mlir][shard] Fix FoldDuplicateShardOp assertion on duplicates in different blocks (#232953)
`FoldDuplicateShardOp` looks for another `shard.shard` of the same value
and checks `otherOp->isBeforeInBlock(op)` to decide which one is the
duplicate. `isBeforeInBlock` asserts when the two ops are not in the
same block, so a value that is annotated once in the function body and
once inside a region (for example a `linalg.generic` or `scf.if` body)
crashes `--canonicalize`:
```
Operation.cpp:382: bool mlir::Operation::isBeforeInBlock(mlir::Operation *): Assertion `other && other->block == block && "Expected other operation to have the same parent block."' failed.
```
The pattern was written for the same-block duplicates that sharding
propagation produces, so just skip the fold when the other op lives in a
different block. Both annotations stay in place, which is always valid.
Adds a canonicalization test with a duplicate inside an `scf.if` region.
[2 lines not shown]
[IndVarSimplify] Use context to prove a narrow IV def non-negative
When IndVars widens an IV, it checks for each narrow def
(the IV and values computed from it) whether it is
non-negative on every iteration.
If it is, zext and sext of it are equal. Then when IndVars
idens the def's users, they can choose to use either
the sext or zext of the def.
Previously, we didn't use context to prove the non-negativity of def.
Now ask SCEV about the def non-negativity at its context -
the def instruction itself.
This allows SCEV to infer facts from the dominating guards and assumes.
This in turn allows eliminating unnecessary truncs/zexts. E.g. in
if (m > 0)
[9 lines not shown]
[AVR] Introduce AVRCodeGenPassBuilder
Mostly mirrors the existing TargetPassConfig. This is for supporting the
NewPM which will eventually replace the LegacyPM.
Reviewers: arsenm, benshi001
Pull Request: https://github.com/llvm/llvm-project/pull/236244
[AMDGPU] Fix invalid CFI when a prologue copies a register to a VCC half (#236119)
A prologue can save the frame pointer or base pointer by copying it to
an unused SGPR, and that SGPR can be vcc_lo or vcc_hi. Their DWARF
register numbers, VCC_32_LO (512) and VCC_32_HI (513), are only defined
in wave32, so in wave64 the CFI named registers that do not exist there.
In wave64, describe the copy as a 32-bit lane of VCC_64 instead.
Assissted By: Cursor
[lldb] Skip debugInfo modules in stats without IncludeModules (#236412)
GetStatistics got every module's symbol file path and debug info modules
unless only a summary was requested.
They arere only reported if the `IncludeModules` option is enabled.
Without `IncludeModules` they were computed and dropped.
Only get them when modules are included.