[mlir][Math] Fix math-expand-ops crash on math.ctlz with index type (#181539)
Fixes #179847
math.ctlz expansion called getIntOrFloatBitWidth() on the operand type
without checking. Index type has no fixed bitwidth and is not int/float,
so the assertion in Type::getIntOrFloatBitWidth() could fire.
- In convertCtlzOp, bail out with notifyMatchFailure when the element
type is not integer or float, so expansion is only applied to types with
a defined bitwidth.
- Add a test in expand-math.mlir that math.ctlz on index is left
unchanged by the pass (no crash, op preserved).
[InstCombine] Avoid invalid bitcast across address spaces in foldIntegerTypedPHI (#181064)
Only use a PtrToInt's source pointer as an available pointer value when
its pointer type exactly matches the inttoptr target type. This prevents
creating an invalid bitcast between differing address spaces during
foldIntegerTypedPHI.
[clang][ObjC][CodeComplete] Fix crash on C-Style cast with parenthesized operand in ObjC++ (#180343)
In ObjC++ mode, code-completion after a C-style cast like
`(int*)(0x200)` crashed because the inner parenthesized expression was
parsed as a `ParenListExpr` (null type) due to `AllowTypes` propagation.
Fixes https://github.com/llvm/llvm-project/issues/180125
[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).