[LifetimeSafety] 'erase' does not invaldiate node-based containers (#181216)
```cpp
// This pattern was previously flagged as a lifetime violation
for (auto it = my_map.begin(); it != my_map.end(); ) {
if (should_delete(*it)) {
my_map.erase(it++); // Safe in map, but flagged as invalidating 'it'
} else {
++it;
}
}
```
[Clang][AMDGPU][Docs] Add builtin documentation for AMDGPU builtins
Use the documentation generation infrastructure to document the AMDGPU builtins.
This PR starts with the ABI / Special Register builtins. Documentation for the
remaining builtin categories will be added incrementally in follow-up patches.
[Clang][TableGen] Add documentation generation infrastructure for builtins
Add a `-gen-builtin-docs` TableGen backend that generates RST
documentation from builtin definitions, modeled after the existing
attribute documentation system (`-gen-attr-docs`).
The emitter generates per-builtin RST sections grouped by category, including
prototype rendering with optional named parameters (via `ArgNames`), target
feature annotations, and documentation content. A mismatch between `ArgNames`
count and prototype parameter count is a fatal error.
[ScalarizeMaskedMemIntrin] Remove redundant RUN: line
5cfd815c14f378c50018f6967c027b758c3996a6 introduced redundant run lines
when doing some NewPM related cleanup. Remove them given they are
identical. LegacyPM coverage is handled through llc.
Reapply "[VPlan] Run narrowInterleaveGroups during general VPlan optimizations. (#149706)"
This reverts commit 8d29d09309654541fb2861524276ada6a3ebf84c.
The underlying issue causing the revert has been fixed independently
as 301fa24671256734df6b7ee65f23ad885400108e.
Original message:
Move narrowInterleaveGroups to to general VPlan optimization stage.
To do so, narrowInterleaveGroups now has to find a suitable VF where all
interleave groups are consecutive and saturate the full vector width.
If such a VF is found, the original VPlan is split into 2:
a) a new clone which contains all VFs of Plan, except VFToOptimize, and
b) the original Plan with VFToOptimize as single VF.
The original Plan is then optimized. If a new copy for the other VFs has
been created, it is returned and the caller has to add it to the list of
[10 lines not shown]
[InstCombine][NFC] Add test for existing fold (#181555)
Resolves #73417.
The fold described in #73417 is already present in LLVM `main`, but it
isn't tested for specifically. This PR adds a test for this fold, based
on the IR in the topmost comment of that issue.
[Github][libc] Use a container for fullbuild tests (#181436)
This avoids needing to set up deps every time and avoids failures due to
failed dependency installation.
Closed #150490.
[llubi] Add basic support for icmp, terminators and function calls (#181393)
Note: icmp with integers is also introduced in this patch, as it is
needed to compute branch conditions.
[RFC][IR] Remove `Constant::isZeroValue` (#181521)
`Constant::isZeroValue` currently behaves same as
`Constant::isNullValue` for all types except floating-point, where it
additionally returns true for negative zero (`-0.0`). However, in
practice, almost all callers operate on integer/pointer types where the
two are equivalent, and the few FP-relevant callers have no meaningful
dependence on the `-0.0` behavior.
This PR removes `isZeroValue` to eliminate the confusing API. All
callers are changed to `isNullValue` with no test failures.
`isZeroValue` will be reintroduced in a future change with clearer
semantics: when null pointers may have non-zero bit patterns,
`isZeroValue` will check for bitwise-all-zeros, while `isNullValue` will
check for the semantic null (which
may be non-zero).
[clang][Python] Use str.format instead of string concatenations (#173861)
This PR replaces string concatenations and the older `%` string
interpolation with `str.format`. Changes along those lines were
originally a part of #173845, but they were moved to a new PR,
where it was decided that `str.format` is preferable over
f-strings.
Changes in this commit are identical to
abf1d0bea04ab5d5ed1be3708ce1cd86707d5c8f, but commit title and
description were changed to correctly reflect the changes.
Revert "[clang][Python] Use fstrings instead of string concatenations (#173861)"
This reverts commit abf1d0bea04ab5d5ed1be3708ce1cd86707d5c8f,
because its title and description are entirely wrong.
f-strings is what was initially proposed, but then it was decided
to go with `str.format`.
[clang] Add explicit std::move(...) to avoid a few copies (#180478)
Moving an std::shared_ptr is always profitable (marginally).
Moving a clang::LayoutOverrideSource::Layout may be profitable depending
on the size of the underlying llvm::SmallVector.
Changes suggested by performance-use-std-move from #179467
[VPlan] Add VPSymbolicValue for UF. (NFC)
Add a symbolic unroll factor (UF) to VPlan similar to VF & VFxUF that
gets replaced with the concrete UF during plan execution, similar to how VF
is used for the vectorization factor. This is a preparatory change that
allows transforms to use the symbolic UF before the concrete UF is
determined.
Note that the old getUF that returns the concrete UF after unrolling has
been renamed to getConcreteUF.
Split off from the re-commit of 8d29d093096
(https://github.com/llvm/llvm-project/pull/149706) as suggested.
[AArch64] Decompose FADD reductions with known zero elements
FADDV is matched into FADDPv4f32 + FADDPv2f32p but this can be relaxed
when one element (usually the 4th) or more are known to be zero.
Before:
movi d1, #0000000000000000
mov v0.s[3], v1.s[0]
faddp v0.4s, v0.4s, v0.4s
faddp s0, v0.2s
After:
mov s1, v0.s[2]
faddp s0, v0.2s
fadd s0, s0, s1