[libc] Add cpp::swap and cpp::clamp utilities (#221236)
Added cpp::swap to src/__support/CPP/utility/swap.h with move semantics
and array support, and cpp::clamp to src/__support/CPP/algorithm.h with
comparator support.
Included unit tests in swap_test.cpp and algorithm_test.cpp.
Adopted the new utilities in initial callsites:
* stdlib: Used cpp::swap in qsort_data.h
* wctype: Used cpp::swap in perfect_hash_map.h
* math: Used cpp::clamp in powf.h
* scanf_core: Used cpp::min and cpp::max in parser.h
Also fixed sign extension when parsing scanset specifiers in parser.h:
signed characters greater than or equal to 128 produced negative values,
inverting comparisons and causing out-of-bounds writes in the bitset.
Scanset characters are now cast through uint8_t, and non-ASCII tests
were added to parser_test.cpp.
Assisted-by: Automated tooling, human reviewed.
[AMDGPU] Remove dead D16ImageDimIntrinsic and lookupD16ImageDimIntrinsic (NFC) (#221660)
The corresponding TableGen table and callers were removed on June 21,
2018 in commit 7a9c03f484fee744b1cbcc45e77f949b4ebfcbee, leaving behind
the struct, the declaration, and the unused macro definition.
Assisted-by: Antigravity
snd_emu10kx: Make sure the block count and size cover the whole buffer
The playback voices always loop over the whole EMU_PLAY_BUFSZ buffer,
but emupchan_setblocksize() only recorded the new block size and left
the block count as it was set up by emu_vinit(). The blocks then no
longer covered the whole buffer, and the part they left out was played
without ever being written to, which became audible as distortion once
playback started going through a virtual channel.
Resize the buffer, so that the block count and size always cover it.
Fixes: 02d4eeabfd73 ("sound: Allocate vchans on-demand")
PR: 287687
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D59444
www/nginx-module-cache-purge: Fix proxy_cache_purge on freenginx
The module mirrors ngx_http_proxy_loc_conf_t privately and enables the
host_set field for nginx_version >= 1029004. freenginx does not have
that field, so plcf->cache_key is read at the wrong offset and a PURGE
request kills the worker process.
Sponsored by: Netzkommune GmbH
[lldb][Fortran] Add Fortran language plugin to LLDB (#221301)
This PR adds the Plugin necessary for LLDB to recognise Fortran.
Subsequent PRs will add the TypeSystem and the DWARFASTParser for
Fortran.
Changes:
- Adds Fortran language Plugin.
- Adds LanguageIsFortran function to the Language class to help identify
Fortran.
Testing:
- Check if language Plugin is registered.
Part of the Add Fortran support to LLDB GSoC 2026 project.
Relates to #109119.
Co-authored-by: Jonas Devlieghere <jonas at devlieghere.com>
[SLP][modularisation][NFC] Move order/mask helpers to SLPUtils (#221663)
Move the following BoUpSLP-independent order/mask helpers out of
SLPVectorizer.cpp into SLPVectorizer/SLPUtils.{h,cpp}:
reorderReuses
reorderOrder
isReverseOrder
isRepeatedNonIdentityClusteredMask
combineOrders
They sit with the existing permutation helpers. Behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[CIR] Derive lowering attr names from cppClassName, not the def name
CIRLoweringEmitter built its CXX_ABI_ALWAYS_LEGAL_ATTRS entries with
GetOpCppClassName, which splits the TableGen def name at the first
underscore. That works only while every def is named CIR_<CppClassName>Attr.
When one is not, the emitter writes an `isa<>` for a class that does not
exist, and the failure lands as a compile error in generated code.
Attributes carry the authoritative name in cppClassName, which
GenerateAttrToValueVisitor was already reading. Factor that out as
GetAttrCppClassRef and use it for both attribute paths. GetOpCppClassName
stays for operations.
NFC, and checkable. No CIR attribute overrides cppClassName, so the generated
CIRLowering.inc is byte-identical.
[CIR] Drop dead ceremony around the CIR enum attributes (#220890)
Five things that no longer earn their place in the CIR enum attribute
machinery.
CIR_CleanupKindAttr carried three. Its cppClassName restated the default
AttrDef already derives. Its skipDefaultBuilders plus hand-written
AttrBuilder existed only to default $value to CleanupKind::All, which no
caller relies on, so the generated builders stayed suppressed for
nothing.
And its summary and description restated the name, overriding the enum's
own
"cleanup kind" that EnumAttr would otherwise inherit. The isNormal, isEH
and
isNormalAndEH helpers stay.
CIR_TLSModelAttr's summary restated its name the same way, so only that
goes.
CIR_DefaultValuedEnumParameter has never had a user.
[docs][libFuzzer] Fix formatting and collapsed definition lists (#206709)
This PR fixes broken formatting and collapsed definition lists in the
libFuzzer documentation by adding missing blank lines.
Closes #206706
Signed-off-by: Anchels <mishtitov at gmail.com>
[AArch64][SVE] Lower extended v2i8 loads using SVE. (#217006)
Loads of v2i8 are promoted to v2i32, which requires two extend
operations; v2i8 -> v2i16, then v2i16 -> v2i32. This comes largely for
free when using SVE's extending loads.
[lldb][Windows] Silence unused variable warning on Windows on Arm (#221176)
<...>/llvm-project/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp(507,8):
warning: unused variable 'log' [-Wunused-variable]
507 | Log *log = GetLog(WindowsLog::Exception);
| ^~~
Move that line into the `#ifndef __aarch64__` block to fix this.
[LV] Use getMaxRuntimeElementCount for MaxPowerOf2RuntimeVF. (#221219)
Use new getMaxRuntimeElementCount to compute MaxPowerOf2RuntimeVF to
avoid overflow by performing computations in uint64_t.
This fixes an overflow in the test added in #219290. We now correctly
determine that a tail is needed for a low trip count loop.
PR: https://github.com/llvm/llvm-project/pull/221219
[clang][CIR][AArch64] Move and reformat SVE test (#220599)
Adapts SVE tests to match the approach that we took for Neon. In
particular, test are moved to:
* "clang/test/CodeGen/AArch64/sve"
There is no change in test coverage.
[X86] Fix eliminateFrameIndex dropping existing index register for huge frame offsets
When the frame offset does not fit in disp32 and the address mode already
uses an index register, the register-scavenging path overwrote the index
operand with the scratch register, silently dropping the index from the
effective address (and applying the stale scale to the frame offset).
Fold the offset into the base register with an LEA in this case instead.
Fixes #213960
Assisted-by: Cursor
Reviewers: RKSimon, qcolombet
Pull Request: https://github.com/llvm/llvm-project/pull/221016
[NFC] Stop relying on the LocationDescription conversion in unit tests. (#221004)
`LocationDescription` has an implicit conversion from a bare insertion
point, and it leaves DL default-constructed. `OpenMPIRBuilderTest`
depends on that in a number of places, either by naming an insertion
point directly or by handing `Builder.saveIP()` to an entry point that
takes a `LocationDescription`.
Spell out what each of those sites means instead. Where a live builder
is already sitting at the insertion point it is passed directly, and
where the test names an insertion point of its own the empty location is
written out, which is what it was getting before, so no test changes
behavior.
Co-authored-by: Cursor <cursoragent at cursor.com>
[CIR][CMake] Configure MLIR as a dependency-only project
ClangIR requires MLIR, but enabling CIR currently requires users to list MLIR
explicitly in LLVM_ENABLE_PROJECTS. That also attaches all MLIR build, install,
unit-test, and lit targets to the corresponding LLVM aggregates.
When Clang is selected and CLANG_ENABLE_CIR is enabled, record MLIR in
LLVM_DEPENDENCY_ONLY_PROJECTS. The common project setup normalizes this request
against LLVM_ENABLE_PROJECTS, so an explicit MLIR selection still takes
precedence while an implicit selection remains dependency-only.
This configures the MLIR targets used by CIR without changing
LLVM_ENABLE_PROJECTS or enabling MLIR's aggregate targets. Keep the existing
standalone ClangIR restriction, and continue to omit MLIR when CIR is disabled.
Assisted-by: Codex
[CMake] Add dependency-only project mode for Flang's MLIR
LLVM_ENABLE_PROJECTS historically treats projects enabled to satisfy another
project's dependency the same as projects selected by the user. Consequently,
enabling Flang attaches the complete MLIR project, install rules, and test
suites to LLVM's aggregate targets.
Record implicit dependencies in the internal-only
LLVM_DEPENDENCY_ONLY_PROJECTS list without changing LLVM_ENABLE_PROJECTS.
Normalize the list after collecting dependencies so duplicate requests are
removed and explicit project selections always take precedence.
Teach project setup to configure the union of both lists and add
dependency-only source directories with EXCLUDE_FROM_ALL. This keeps every
MLIR target available for normal dependency resolution while omitting MLIR-wide
build and install targets. Flang is the first user of this mode.
Let MLIR own its dependency-only test policy: configure test support libraries
for downstream consumers without creating MLIR unit tests or registering its
[3 lines not shown]
[clang-tidy][NFC] Convert check list to yaml format (#221411)
Yaml format was introduced in 19-20 release which is old enough to
safely transition our file to new version since we are on 23 release
already.