[LLD][ELF] Skip non-inputsections to avoid invalid cast in Arm BE8 handling (#188154)
This patch fixes https://github.com/llvm/llvm-project/issues/187033
In BE8 mode, instruction bytes are reversed for sections containing
code. This logic currently assumes that arm mapping symbols (e.g. $a,
$t, $d) are always associated with InputSections.
However, mapping symbols can also be defined in other section types such
as mergeable sections (SHF_MERGE). These are not represented as
InputSection, and attempting to cast them using
cast_if_present<InputSection> results in an assertion failure.
[BOLT][AArch64] Strip uneeded labels from FEAT_CMPBR tests. (#189931)
Eliminates the temporary labels so that BOLT does not recognize them as
secondary entry points.
[MLIR][Linalg] Generic to category specialization for unary elementwise ops (#187217)
Handle specialization of `linalg.generic` ops representing a unary
elementwise computation to the `linalg.elementwise` category op. This
implements a previously absent path in the linalg morphism.
[RISCV][TTI] Update cost and prevent exceed m8 for vector.extract.last.active (#188160)
This patch contains two parts.
1. Update costs reflect to the codegen changes. This is not that
accurate since the step vector can use smaller type if there is a
vscale_range attribute. But we cannot get that in the type-based query
in TTI.
2. Return invalid cost for the vector.extract.last.active that needs
vector split for the step vector. But currently this is not handled
correctly and will hit the assertion.
For not blocking the FindLast reduction in LV
(https://github.com/llvm/llvm-project/pull/184931). We should land this
first and fix the SelectionDAG for vector.extract.last.active lowering.
[AArch64][llvm] Some instructions should be `HINT` aliases (NFC)
Implement the following instructions as a `HINT` alias instead of a
dedicated instruction in separate classes:
* `stshh`
* `stcph`
* `shuh`
* `tsb`
Updated all their helper methods too, and updated the `stshh` pseudo
expansion for the intrinsic to emit `HINT #0x30 | policy`.
Code in AArch64AsmPrinter::emitInstruction identified an initial BTI using a
broad bitmask on the HINT immediate, which also matched shuh/stcph (50..52)
This could move the patchable entry label after a non-BTI instruction.
Replaced it with an exact BTI check using the BTI HINT range (32..63) and
AArch64BTIHint::lookupBTIByEncoding(Imm ^ 32).
A following change will remove duplicated code and simplify.
[2 lines not shown]
[CostModel] Move default expand cost for partial reductions to BasicTTIImpl (#189905)
This is a follow-up of the suggestion left here:
https://github.com/llvm/llvm-project/pull/181707#discussion_r2995733831
The override functions in AMDGPU/ARM/SystemZ/X86 are required to avoid
enabling partial reductions where they were previously disabled (I've
added this for all targets that implement getArithmeticReductionCost).
[AArch64][llvm] Some instructions should be `HINT` aliases (NFC)
Implement the following instructions as a `HINT` alias instead of a
dedicated instruction in separate classes:
* `stshh`
* `stcph`
* `shuh`
* `tsb`
Updated all their helper methods too, and updated the `stshh` pseudo
expansion for the intrinsic to emit `HINT #0x30 | policy`.
Code in AArch64AsmPrinter::emitInstruction identified an initial BTI using a
broad bitmask on the HINT immediate, which also matched shuh/stcph (50..52)
This could move the patchable entry label after a non-BTI instruction.
Replaced it with an exact BTI check using the BTI HINT range (32..63) and
AArch64BTIHint::lookupBTIByEncoding(Imm ^ 32).
A following change will remove duplicated code and simplify.
[2 lines not shown]
[lldb][AArch64][Linux] Qualify uses of user_sve_header (#190130)
Fixes #165413. Where a build failure was reported:
```
/b/s/w/ir/x/w/llvm-llvm-project/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:1182:9: error: unknown type name 'user_sve_header'; did you mean 'sve::user_sve_header'?
1182 | user_sve_header *header =
| ^~~~~~~~~~~~~~~
| sve::user_sve_header
```
To fix this, add sve:: as we do for all other uses of this.
This is LLDB's copy of a structure that Linux also defines. I think the
build worked on some machines because that version ended up being
included, but with a more isolated build, it may not.
We have our own definition of it so we can be sure what we're using in
case Linux extends it later.
[Clang][LoongArch] Align LSX/LASX built-in signatures with intrinsic types to avoid lax conversions (#189900)
Update the built-in signatures in BuiltinsLoongArchLSX.def and
BuiltinsLoongArchLASX.def to precisely match the vector types used in
the corresponding intrinsic headers (lsxintrin.h and lasxintrin.h).
This alignment ensures that these intrinsics can be compiled
successfully even when -flax-vector-conversions=none is specified, since
the built-in arguments no longer rely on implicit vector type
conversions.
Added new test cases to verify the macro-defined LSX/LASX
intrinsic interfaces under -flax-vector-conversions=none.
Fixes #189898
libc/amd64/strrchr.S: rewrite and fix scalar implementation
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character. It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().
Rewrite the function with logic that actually works. We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.
This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)). The default configuration is not affected.
The bug was unfortunately not caught by the unit test inherited
from NetBSD. An extended unit test catching the issue is proposed
in D56037.
[9 lines not shown]
[clang][analyzer] Forward CTU-import failure conditions
Forward all CTU-import failures as diagnostics (remarks, warnings,
errors), except for `index_error_code::missing_definition` which has the
potential of generating too many diagnostics.
--
CPP-7804
libc/amd64/strrchr.S: rewrite and fix scalar implementation
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character. It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().
Rewrite the function with logic that actually works. We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.
This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)). The default configuration is not affected.
The bug was unfortunately not caught by the unit test inherited
from NetBSD. An extended unit test catching the issue is proposed
in D56037.
[9 lines not shown]
Move ExpandMemCmp and MergeIcmp to the middle end (#77370)
Moving these into the middle-end pipeline will allow for additional
optimization of the expansion result, such as CSE of redundant loads
(c.f. https://godbolt.org/z/bEna4Md9r). For now, we conservatively place
the passes at the end of the middle-end pipeline, so we mostly don't
benefit from additional optimizations yet. The pipeline position will be
moved in a future change.
This builds on work done by legrosbuffle in
https://reviews.llvm.org/D60318.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
py-test-mypy-plugins: updated to 4.0.0
4.0.0
Bugfixes
Breaking: Errors are now ignored in site-packages by default. The --mypy-only-local-stub flag
has been removed and replaced with --mypy-no-silence-site-packages which can be used to restore
the previous behavior if needed. This change was made to avoid errors being raised when enabling
certain mypy options, e.g. the explicit-override error code or the --disallow-subclassing-any
flag, which resulted in violations due to these not being supported with the stubs provided by
typeshed for the standard library. In addition, this affected other error codes or flags for some
third-party libraries in django-stubs.
Breaking: When running in a subprocess (the default), PYTHONPATH is no longer set. With the
above change, violations would still be raised in the main module for a test case, but those that
were flagged in imported modules would no longer be raised. This was because these modules were
being added to PYTHONPATH which caused mypy to treat them as belonging in site-packages and not
as part of the first-party package. The new --mypy-modify-pythonpath flag can be used to revert
to the previous behavior if needed.
py-mypy: updated to 1.20.0
1.20.0
* Planned Changes to Defaults and Flags in Mypy 2.0
* Better Type Narrowing
* Drop Support for Python 3.9
* Mypyc Accelerated Mypy Wheels for ARM Windows and Free Threading
* Improved Compatibility for Local Partial Types
* The inferred type of 'x' is always 'int | None'.
* Python 3.14 T-String Support (PEP 750)
* Experimental New Parser
* Performance Improvements
* Improvements to Allowing Redefinitions
* mypy: allow-redefinition-new, local-partial-types
* Incremental Checking Improvements
* Fixes to Crashes
* Mypyc: Faster Imports on macOS
* librt: Mypyc Standard Library
[9 lines not shown]