[ADT] Add is_sorted_constexpr, equivalent to C++20 std::is_sorted (#180867)
`std::is_sorted` is not `constexpr` until Cpp20, so need custom `is_sorted_constexpr` function.
[CIR][docs] Add cir.catch_param to ClangIR cleanup and EH design doc (#181284)
This updates the ClangIR cleanup and exception handling design document
to describe the requirement to use cir.catch_param operations to begin
the catch regions of a cir.try operation in the structured form of CIR.
This also includes minor changes to the descriptions in the CIROps.td
definitions of cir.try and cir.catch_param
[AArch64][clang][llvm] Add ACLE `stshh` atomic store builtin
Add `__arm_atomic_store_with_stshh` implementation as defined
in the ACLE. Validate that the arguments passed are correct, and
lower it to the stshh intrinsic plus an atomic store with the
allowed orderings.
Gate this on FEAT_PCDPHINT so that availability matches
hardware support for the `STSHH` instruction. Use an i64
immediate and side-effect modeling to satisfy tablegen and decoding.
[OpenMP][lit] Disable flaky test tasking/issue-94260-2.c (#176452)
The test sporadically fails on Linux. See
https://github.com/llvm/llvm-project/issues/176451 for more info.
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
[AArch64][clang][llvm] Add ACLE `stshh` atomic store builtin
Add `__arm_atomic_store_with_stshh` implementation as defined
in the ACLE. Validate that the arguments passed are correct, and
lower it to the stshh intrinsic plus an atomic store with the
allowed orderings.
Gate this on FEAT_PCDPHINT so that availability matches
hardware support for the `STSHH` instruction. Use an i64
immediate and side-effect modeling to satisfy tablegen and decoding.
[clang] avoid reentering header-name lexing on nested macro expansion (#179151)
Fixes #178635
---
This PR addressed the issue when header-name _lexing_ reentered on
nested macro expansion.
`__has_include`/`__has_embed` lex a header name by calling
`LexHeaderName`, and neither expects nested expansion in that context.
If `__has_include` appears inside the header name expression (e.g.,
`__has_include(__has_include)`, or `__has_embed(__has_include)`)
https://github.com/llvm/llvm-project/blob/6a18039298174562a38f28ca06d12dcbf7f14f06/clang/lib/Lex/PPMacroExpansion.cpp#L1252
macro expansion reenters `LexHeaderName` and hits the assertion
[5 lines not shown]
[CodeGen][AMDGPU] TwoAddress: Only skip undef COPY at REG_SEQUENCE lowering when there is Live info or no uses for subreg (#175598)
Currently, the compiler doesn't create a COPY for undef operands while
lowering REG_SEQUENCE, and only if LIS information is available, it
propagates the undef flag to the subreg uses. So, if LIS isn't
available, we can end up with some uses without def of those lanes.
Now, we check which lanes are used in a single scan of
use_nodbg_operands() per REG_SEQ, and perform the skip of the COPY only
if LIS is avaible (as undef will be propagated later) or if there are no
uses for that lane.
There is still a scan of the use list, but now it's only one per REG_SEQ
and I think it's necessary, as there is no guarantee to have LIS or
other analysis pass information at this stage.
This is a proposal fix for issue:
https://github.com/llvm/llvm-project/issues/175596
---------
Co-authored-by: Carl Ritson <critson at perlfu.co.uk>
[LV] Vectorize early exit loops with multiple exits. (#174864)
Building on top of the recent changes to introduce BranchOnTwoConds,
this patch adds support for vectorizing loops with multiple early exits,
all dominating a countable latch. The early exits must form a
dominance chain, so we can simply check which early exit has been taken
in dominance order.
Currently LoopVectorizationLegality ensures that all exits other than
the latch must be uncountable. handleUncountableEarlyExits now collects
those uncountable exits and processes each exit.
In the vector region, we compute if any exit has been taken, by taking
the OR of all early exit conditions (EarlyExitConds) and checking if
there's
any active lane.
If the early exit is taken, we exit the loop and compute which early
exit
[8 lines not shown]
[lldb] Pass the frame's language type to the highlighter (#181094)
This threads the frame's language type through the source manager to the
highlighter. Previously, we'd always pass "unknown" as the language type
and rely on the language plugin to figure out the language based on the
file extension.
This change is motivated by #170250. For languages like Swift or Rust
that don't have an upstream language plugin, we need the frame's
language for syntax highlighting.
[Github] Update requirements_formatting.txt (#181184)
We should not need to be explicitly adding transitive dependencies to
requirements_formatting.txt.in to enforce a higher version is used. We
also should always be using == to ensure a strict version match, not
just a compatible version (~=). This patch removes transitive
dependencies introduced in 6fdf93c5d812197dd5dc9362f324b944105b2e8e and
updates the lockfile (although only unnecessary packages are removed).
[clang-tidy] Header check support for check_clang_tidy.py (#175735)
As of AI-Usage: Gemini CLI was used for pre-commit review and finding
testcases that need to be updated.
Closes [#133515](https://github.com/llvm/llvm-project/issues/133515)
---------
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
[LangRef][ConstantTime] Add documentation for llvm.ct.select.* constant-time intrinsics (#181042)
This PR introduces and documents the llvm.ct.select.* constant-time
intrinsics, providing timing-independent selection operations for
security-sensitive code. The LangRef is updated with syntax, semantics,
supported types, and usage guidance.
Additionally, test coverage is extended with a new <8 x float> variant
(llvm.ct.select.v8f32) and corresponding X86 codegen tests to ensure
correct lowering on both x64 and x32 targets.
[VPlan] Reuse introduces-broadcast logic in narrowToSingleScalars (#174444)
narrowToSingleScalarRecipes' operands check is a bit too restrictive by
permitting a single user. Factor out and reuse the existing
introduces-broadcast logic to improve results.
[MLIR][Docs] Add docs about Python-defined dialects (#181372)
This PR adds documentation to the MLIR Python bindings introducing
support for Python-defined dialects (initially introduced in #169045).
Add HexagonGlobalScheduler pass (#180803)
This patch adds the HexagonGlobalScheduler, a post-packetization pass
that performs global instruction scheduling and pull-up optimizations to
improve packet density on Hexagon VLIW architecture.
The scheduler operates on scheduling regions (super-blocks with single
entry and multiple exits) and attempts to move instructions across basic
blocks to fill packet slots more efficiently. It supports both
speculative and predicative scheduling modes.
Key features:
- Global instruction scheduling across basic blocks
- Speculative scheduling with safety checks
- Predicative scheduling using predication
- Local pull-up within basic blocks
- Dual jump formation
- Branch optimizations
- Liveness preservation using HexagonLiveVariables
[24 lines not shown]
[libc++] Run all the microbenchmarks in run-benchmarks (#181374)
Running all the benchmarks does not significantly increase the total
time, and it ensures that what we upload to LNT corresponds exactly to
what's in the test suite.
[NFCI][analyzer] Regularize NodeBuilder classes (#180960)
This commit removes virtual methods from the `NodeBuilder` class
hierarchy (because they were only relevant for the "enclosing builder"
feature of `StmtNodeBuilder` which was not used anywhere), then moves
the classes `IndirectGotoNodeBuilder` and `SwitchNodeBuilder` into this
hierarchy. (Previously they were independent classes with some
duplicated logic in the `generateNode()`-like functions.)
Updating `SwitchNodeBuilder` is a prerequisite for activating the
`BranchCondition` checkers on the condition of the `switch` statement
because `CheckerContext` requires the presence of a `NodeBuilder`.
Updating `IndirectGotoNodeBuilder` doesn't have any analogous goals --
I'm just doing it for the sake of consistency.
I also added some very basic tests because this area wasn't properly
covered by the old tests.
I'm planning to do more cleanup (e.g. the removal of `StmtNodeBuilder`)
in follow-up commits.