LLVM/project 3691603llvm/lib/Target/SPIRV SPIRVLegalizerInfo.cpp, llvm/test/CodeGen/SPIRV/legalization matrix-wide-vector-shader.ll vector-legalization-shader.ll

[SPIRV][Matrix] Change Matrix Shader legalization to largest common divisor (#207768)

fixes #186864

New process for matrix legalization documented here:
https://github.com/llvm/wg-hlsl/pull/446

The current Matrix legalization strategy is to take a vector of and
expanded to a larger power of 2 vector and then split it into vectors of
size 4. For example a vector of size 6 is expanded to 8, and then split.

This creates uniform 4-lane chunks but requires padding. For example
`<12>`-->`<16>`, `<6>`-->`<8>`, `<9>`-->`<16>`. These forces an illegal
wide `G_BUILD_VECTOR` with undef lanes. This padding wastes lanes and
  adds undef bookkeeping the backend must then clean up.

Instead This PR splits both operands into `W`-lane chunks, where `W` is
the largest divisor of the element count in `[2, MaxVectorSize]` shared
by source and destination (`<12>`-->3×`<4>`, `<6>`-->2×`<3>`,

    [4 lines not shown]
DeltaFile
+218-4llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
+166-0llvm/test/CodeGen/SPIRV/legalization/matrix-wide-vector-shader.ll
+113-0llvm/test/CodeGen/SPIRV/llvm-intrinsics/matrix-transpose-bool.ll
+10-12llvm/test/CodeGen/SPIRV/legalization/vector-legalization-shader.ll
+11-9llvm/test/CodeGen/SPIRV/llvm-intrinsics/matrix-multiply.ll
+7-9llvm/test/CodeGen/SPIRV/llvm-intrinsics/matrix-transpose.ll
+525-341 files not shown
+531-357 files

LLVM/project 7f14005.github/workflows libcxx-pr-benchmark.yml libcxx-benchmark-commit.yml, libcxx/utils benchmark-historical test-at-commit

[libc++] Pin down the compiler in the various benchmark scripts and jobs (#211563)

We have various scripts that build and test the library at pinpointed
commits: benchmark-historical, run-benchmarks, build-at-commit and
test-at-commit. They were handling the compiler in different ways: some
scripts would just run the libc++ build (or test suite configuration)
without specifying the compiler, which means the $CXX environment
variable was used if present. Other scripts (e.g. run-benchmarks) would
accept the compiler as an argument, but would fail to pass it down when
configuring the test suite, which led to issues.

This patch passes the compiler explicitly in all scripts: this removes
any potential confusion around how the compiler should be specified (env
var or argument). The only exception is build-at-commit, where the
compiler is still specified by passing the appropriate CMake arguments.
The reason for this exception is that passing arguments to CMake is
actually the way we want to configure aspects of the build (and the test
suite) in the long term, it's just that the test suite doesn't support
this cleanly due to the CMake/Lit split at the moment.

    [3 lines not shown]
DeltaFile
+13-21.github/workflows/libcxx-pr-benchmark.yml
+4-2.github/workflows/libcxx-benchmark-commit.yml
+5-1libcxx/utils/benchmark-historical
+3-0libcxx/utils/test-at-commit
+1-0libcxx/utils/ci/lnt/run-benchmarks
+26-245 files

LLVM/project 89e637allvm/test/CodeGen/AMDGPU llvm.amdgcn.raw.atomic.buffer.load.ll llvm.amdgcn.raw.ptr.atomic.buffer.load.ll

[NFC][AMDGPU] Remove reundant run lines from two test cases (#211575)
DeltaFile
+0-44llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.atomic.buffer.load.ll
+0-44llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.ptr.atomic.buffer.load.ll
+0-882 files

LLVM/project 710cca1llvm/lib/Transforms/Vectorize LoopVectorize.cpp

[LV] Use planner's TTI in executePlan instead of CM.TTI (NFC) (#211588)

LoopVectorizationPlanner already holds TTI, no need to go through CM.
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+1-11 files

LLVM/project 8d933f7clang/lib/Sema HLSLBuiltinTypeDeclBuilder.cpp, clang/test/CodeGenHLSL/builtins RWByteAddressBuffer-InterlockedAdd.hlsl RasterizerOrderedByteAddressBuffer-InterlockedAdd.hlsl

Add InterlockedAdd resource methods (#208128)

This PR builds upon the work merged in
https://github.com/llvm/llvm-project/pull/195742, and completes the
implementation of the InterlockedAdd functions in HLSL, by adding these
methods to the existing resource types.
Fixes: https://github.com/llvm/llvm-project/issues/99122
Assisted by: Github Copilot
DeltaFile
+122-1llvm/lib/Target/DirectX/DXILResourceAccess.cpp
+62-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedAdd.hlsl
+61-0clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp
+59-0llvm/test/CodeGen/DirectX/ResourceAtomicBinOp.ll
+0-52llvm/test/CodeGen/DirectX/InterlockedAdd.ll
+45-0clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedAdd.hlsl
+349-5319 files not shown
+576-15625 files

LLVM/project 6425cf4clang/lib/Lex Preprocessor.cpp

[NFC][Clang][Lex] Add assert to prevent null pointer dereference in Preprocessor::HandleModuleContextualKeyword (#211117)

Coverity static analysis scans on clang are unhappy with
[this](https://github.com/llvm/llvm-project/blob/e55d3bca36ff8a23ef598f6f452ec1e3f399dc31/clang/lib/Lex/Preprocessor.cpp#L920)
invocation of `HandleModuleContextualKeyword` due to the fact that
_technically_ nothing is stopping `CurPPLexer` reference in
`Preprocessor` from being `nullptr`, although AFAICT the current code
ensures this doesn't happen when `Preprocessor` is in file-lexing mode.

However, an assertion could be added to `HandleModuleContextualKeyword`
for future debugging's sake.

---------

Co-authored-by: Yihan Wang <yronglin777 at gmail.com>
DeltaFile
+2-0clang/lib/Lex/Preprocessor.cpp
+2-01 files

LLVM/project ca20485lldb/include/lldb/Symbol Function.h, lldb/source/Symbol Function.cpp SymbolContext.cpp

[lldb] Create a GetStartLineEntry helper (#211264)

A WebAssembly function's entry address points at the locals-declaration
header, which carries no line information, so the first line table row
begins past the entry point.

We already handled this in GetPrologueByteSize (dd069b691dd3), but there
are other places that need the same support (GetStartLineSourceInfo,
GetFunctionStartLineEntry). Rather than duplicating the logic, create a
shared helper.
DeltaFile
+95-0lldb/test/Shell/SymbolFile/DWARF/x86/source-list-function-entry-not-covered.s
+31-36lldb/source/Symbol/Function.cpp
+26-4lldb/include/lldb/Symbol/Function.h
+1-1lldb/source/Symbol/SymbolContext.cpp
+153-414 files

LLVM/project fb90ae1flang/lib/Semantics check-omp-structure.cpp check-omp-structure.h, llvm/include/llvm/Frontend/OpenMP OMP.td

[flang][OpenMP] Switch TableGen generation to use llvm::EnumSet

Replace the remaining uses of the common::EnumSet-based OmpClauseSet to
llvm::omp::ClauseSet.
DeltaFile
+20-19flang/lib/Semantics/check-omp-structure.cpp
+4-9flang/lib/Semantics/check-omp-structure.h
+1-1llvm/include/llvm/Frontend/OpenMP/OMP.td
+25-293 files

LLVM/project 98e7135llvm/lib/Transforms/Utils LCSSA.cpp, llvm/test/Transforms/LCSSA lifetime-markers.ll

[LCSSA] Avoid rewriting lifetime markers through PHIs (#210811)

Lifetime intrinsics have been required to reference an alloca directly
since #149310. LCSSA can currently violate that invariant when a
loop-local alloca has a lifetime marker outside the loop: SSA
reconstruction rewrites the marker operand through an exit PHI, and the
verifier rejects the result.

Collect lifetime markers while scanning uses. If one crosses the loop
boundary, conservatively erase the complete marker set for that alloca
instead of rewriting any marker. Removing the markers extends the
modeled lifetime and preserves program semantics. This follows the same
strategy adopted for JumpThreading in #188147.

The regression test covers both sides of the behavior:

- a lifetime end outside the loop drops both the start and end markers;
- markers that remain inside the loop are preserved while another alloca
use receives an LCSSA PHI.

    [7 lines not shown]
DeltaFile
+55-0llvm/test/Transforms/LCSSA/lifetime-markers.ll
+19-0llvm/lib/Transforms/Utils/LCSSA.cpp
+74-02 files

LLVM/project 1e7817cclang/lib/StaticAnalyzer/Checkers LifetimeModeling.cpp

[NFC][analyzer] Apply any_of to detect destructors stack frame (#211582)

Since #210938 is merged I have also applied the same parent-chain helper
to detect if a destructor's stack frame is on the current stack.
DeltaFile
+4-4clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+4-41 files

LLVM/project a3e1f94llvm/include/llvm/IR RuntimeLibcalls.td, llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

RuntimeLibcalls: Add generic FCMP3_F* three-way compare for single-symbol ABIs

MSP430's __mspabi_cmpd/__mspabi_cmpf are one three-way compare symbol serving
every predicate, previously modeled as six suffixed impls each. Replace them
with a single generic operator FCMP3_*, and give softenSetCCOperands a 3rd
lowering option. After the boolean O*_F* and the per-predicate FCMP3_<pred>_F*
helpers, use the generic FCMP3_F* helper tested with the predicate's condition
code.

Also opt __nedf2 out of the MSP430 default set: it was the only libgcc F64
compare not already opted out, so it would otherwise provide FCMP3_UNE_F64 and
win over __mspabi_cmpd for not-equal.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+45-40llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+11-26llvm/include/llvm/IR/RuntimeLibcalls.td
+56-662 files

LLVM/project 8d4f236libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt sched_setscheduler.h, libc/src/pthread pthread_getschedparam.cpp

[libc] Implement pthread_setschedparam and getschedparam (#205770)

Implemented the pthread_setschedparam and pthread_getschedparam
functions.

Added Linux syscall wrappers:
* sched_setscheduler
* sched_getscheduler
* sched_getparam

Updated the Thread class to support getting and setting scheduling
parameters.

Added integration tests to verify the implementation.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+92-0libc/test/integration/src/pthread/pthread_setschedparam_test.cpp
+41-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+41-0libc/src/pthread/pthread_getschedparam.cpp
+37-0libc/src/__support/OSUtil/linux/syscall_wrappers/sched_setscheduler.h
+36-0libc/src/__support/OSUtil/linux/syscall_wrappers/sched_getparam.h
+35-0libc/src/__support/OSUtil/linux/syscall_wrappers/sched_getscheduler.h
+282-015 files not shown
+509-021 files

LLVM/project 10e0a2eclang/lib/StaticAnalyzer/Checkers/WebKit RawPtrRefCallArgsChecker.cpp RawPtrRefLambdaCapturesChecker.cpp

[WebKit Checkers] Share the safety model of WebKit smart pointers (#210195)

This PR introduces PtrRefSafetyModel to abstract away type checks for
various smart pointer types in WebKit to share more code between
different checkers.
DeltaFile
+42-106clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp
+49-75clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp
+111-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefSafetyModel.cpp
+30-64clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLocalVarsChecker.cpp
+92-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefSafetyModel.h
+30-46clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefMemberChecker.cpp
+354-2911 files not shown
+355-2917 files

NetBSD/pkgsrc-wip d238d5bcadical distinfo, cadical/patches patch-makefile.in

cadical: link to upstream bug
DeltaFile
+1-1cadical/distinfo
+1-0cadical/patches/patch-makefile.in
+2-12 files

LLVM/project cef2ec3clang/lib/Driver/ToolChains CommonArgs.cpp, clang/test/Driver amdgpu-mcpu.cl hip-sanitize-options.hip

clang/AMDGPU: Stop passing redundant -target-cpu to cc1

Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.
DeltaFile
+62-62clang/test/Driver/amdgpu-mcpu.cl
+26-26clang/test/Driver/hip-sanitize-options.hip
+20-10clang/lib/Driver/ToolChains/CommonArgs.cpp
+12-16clang/test/Driver/hip-rdc-device-only.hip
+10-10clang/test/Driver/amdgpu-xnack-sramecc-flags.c
+6-6clang/test/Driver/cuda-flush-denormals-to-zero.cu
+136-13026 files not shown
+190-21132 files

LLVM/project 4a100a9clang/lib/Basic OffloadArch.cpp, clang/lib/Driver Driver.cpp

clang: Start using new amdgpu subarch triples

Fixup invocations using --target=amdgcn + -mcpu to introduce
the subarch in the triple.

For offload toolchains, a single toolchain is constructed for the
top level amdgpu architecture, and the effective triple is used for
target specific tool invocations.

The specifics of the resource directory layout are tbd. This does
try to find resources in the subarch named directory. The paths
are searched at toolchain creation time, so that does not work
when there are multiple subarches.

Fixes #154925
DeltaFile
+234-2clang/lib/Basic/OffloadArch.cpp
+59-59clang/test/Driver/offload-arch-translation-amdgpu.cu
+43-43clang/test/Driver/hip-phases.hip
+33-33clang/test/Driver/hip-binding.hip
+48-14clang/lib/Driver/ToolChains/CommonArgs.cpp
+43-12clang/lib/Driver/Driver.cpp
+460-163105 files not shown
+1,212-500111 files

LLVM/project 63db937llvm/include/llvm/IR RuntimeLibcalls.td, llvm/lib/CodeGen TargetLoweringBase.cpp

RuntimeLibcalls: Split soft-float three-way compares into distinct libcall kinds

Soft-float compares come in two flavors. ARM AEABI (__aeabi_dcmpeq) and VFP
(__eqdf2vfp) return a simple 0/1 boolean and use the existing O*_F* / UO_F*
libcalls. The libgcc/compiler-rt helpers (__eqdf2, __ltdf2, ...) return a
three-way -1/0/1, which the legalizer needs to insert the appropriate compare
against.

The three-way helpers previously masqueraded as O*_F* implementations, with the
condition code recovered from a hardcoded switch. Model them instead as distinct
operations. The legalizer then reasons about how to make use of the call result
based on which flavor of operation is available, rather than special casing what
the specific implementation is.

This leaves the mspabi cases for a later cleanup, because it's 3-way usage is
slightly different from the ARM case.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+74-54llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+68-56llvm/include/llvm/IR/RuntimeLibcalls.td
+52-28llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
+0-69llvm/lib/CodeGen/TargetLoweringBase.cpp
+18-0llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
+8-6llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+220-2131 files not shown
+220-2187 files

LLVM/project ef7f833flang/lib/Semantics check-directive-structure.h check-omp-structure.cpp

Specialize IterateOverMembers instead of ClauseSetToString

There was still a use of common::EnumSet::IterateOverMembers left
over after the prior changes. Get rid of it via the specialization,
and revert the specialization of ClauseSetToString, which was
originally implemented using IterateOverMembers.
DeltaFile
+22-7flang/lib/Semantics/check-directive-structure.h
+4-11flang/lib/Semantics/check-omp-structure.cpp
+3-9flang/lib/Semantics/check-acc-structure.cpp
+2-2flang/lib/Semantics/check-omp-structure.h
+2-2flang/lib/Semantics/check-acc-structure.h
+33-315 files

LLVM/project 51bad58flang/lib/Semantics check-directive-structure.h check-omp-structure.cpp

[flang] Provide "clause set" type as parameter to DirectiveStructureChecker

This will remove the hardcoded dependence of DirectiveStructureChecker on
the common::EnumSet class. Both consumers of it will be able to use their
own type for the clause set.

The only complication was the ClauseSetToString member function, whose
implementation depended on the specifics of common::EnumSet, namely the
IterateOverMembers member function. It was moved out of the class, and
turned into a function template to make it possible to provide different
specializations for common::EnumSet and llvm::EnumSet.
DeltaFile
+59-75flang/lib/Semantics/check-directive-structure.h
+14-1flang/lib/Semantics/check-omp-structure.cpp
+12-0flang/lib/Semantics/check-acc-structure.cpp
+5-1flang/lib/Semantics/check-acc-structure.h
+5-1flang/lib/Semantics/check-omp-structure.h
+95-785 files

LLVM/project ab066eaflang/lib/Lower/OpenMP OpenMP.cpp

format
DeltaFile
+6-2flang/lib/Lower/OpenMP/OpenMP.cpp
+6-21 files

LLVM/project 1f023bfflang/include/flang/Semantics openmp-directive-sets.h, flang/lib/Lower/OpenMP OpenMP.cpp

[flang][OpenMP] Use llvm::omp::DirectiveSet instead of common::EnumSet

Replace uses of OmpDirectiveSet (defined in terms of common::EnumSet)
with the common llvm::omp::DirectiveSet (defined via llvm::EnumSet).

The llvm::omp::DirectiveSet class will also be used in openmp-parsers,
where OmpDirectiveSet was an instance of llvm::Bitset.
DeltaFile
+58-60flang/include/flang/Semantics/openmp-directive-sets.h
+23-24flang/lib/Lower/OpenMP/OpenMP.cpp
+21-23flang/lib/Parser/openmp-parsers.cpp
+10-9flang/lib/Semantics/check-omp-structure.cpp
+2-2flang/lib/Semantics/check-omp-structure.h
+2-0llvm/include/llvm/Frontend/OpenMP/OMP.h
+116-1181 files not shown
+117-1197 files

LLVM/project 34ff8e3flang/include/flang/Semantics symbol.h, flang/lib/Semantics resolve-directives.cpp check-omp-structure.h

[flang][OpenMP] Use llvm::omp::ClauseSet instead of common::EnumSet

Replace uses of OmpClauseSet (defined in terms of common::EnumSet)
with the common llvm::omp::ClauseSet (defined via llvm::EnumSet).
DeltaFile
+18-19flang/lib/Semantics/resolve-directives.cpp
+17-14flang/include/flang/Semantics/symbol.h
+10-9flang/lib/Semantics/check-omp-structure.h
+8-9flang/lib/Semantics/symbol.cpp
+5-5flang/lib/Semantics/mod-file.cpp
+3-3flang/lib/Semantics/check-omp-structure.cpp
+61-593 files not shown
+66-619 files

LLVM/project ae1f66dllvm/include/llvm/Frontend/OpenMP OMP.h

Add some static helper members
DeltaFile
+3-0llvm/include/llvm/Frontend/OpenMP/OMP.h
+3-01 files

LLVM/project 73aa456llvm/unittests/Frontend EnumSetTest.cpp CMakeLists.txt

Add unit test
DeltaFile
+134-0llvm/unittests/Frontend/EnumSetTest.cpp
+1-0llvm/unittests/Frontend/CMakeLists.txt
+135-02 files

LLVM/project 98a6495llvm/include/llvm/Frontend/OpenMP OMP.h, llvm/unittests/Frontend EnumSetTest.cpp

Add type-preserving operators |, &, |=, &=
DeltaFile
+22-2llvm/unittests/Frontend/EnumSetTest.cpp
+17-0llvm/include/llvm/Frontend/OpenMP/OMP.h
+39-22 files

LLVM/project c298136llvm/include/llvm/Frontend/OpenMP OMP.h, llvm/unittests/Frontend EnumSetTest.cpp

Fix out of bounds word access in iterator
DeltaFile
+77-0llvm/unittests/Frontend/EnumSetTest.cpp
+4-4llvm/include/llvm/Frontend/OpenMP/OMP.h
+81-42 files

LLVM/project 0e45fffllvm/unittests/Frontend EnumSetTest.cpp

Add preamble
DeltaFile
+8-0llvm/unittests/Frontend/EnumSetTest.cpp
+8-01 files

LLVM/project 3ac7239llvm/include/llvm/Frontend/OpenMP OMP.h

[OpenMP] Implement EnumSet container

This is close to flang's common::EnumSet with the difference being that
it provides forward iterators.

The reason for having an implementation that is separate from
common::EnumSet is that this is intended to be shared for all consumers
of llvm/lib/Frontend/OpenMP. This class is also planned to be one of the
core containers for representing auto-generated OpenMP data in the future.
DeltaFile
+104-0llvm/include/llvm/Frontend/OpenMP/OMP.h
+104-01 files

LLVM/project 09721b0llvm/include/llvm/Frontend/OpenMP OMP.h, llvm/unittests/Frontend EnumSetTest.cpp

Add type-preserving operators |, &, |=, &=
DeltaFile
+22-2llvm/unittests/Frontend/EnumSetTest.cpp
+17-0llvm/include/llvm/Frontend/OpenMP/OMP.h
+39-22 files

OpenBSD/ports ldaTKIVdevel/got distinfo Makefile

   7.9-stable: update to got-0.127
VersionDeltaFile
1.125.2.3+2-2devel/got/distinfo
1.144.2.3+1-1devel/got/Makefile
+3-32 files