LLVM/project 801baecllvm/lib/Target/PowerPC PPCISelLowering.cpp

PowerPC: Drop AllowFPOpFusion from isProfitableToHoist

Exclusively rely on the contract flags on individual instructions
to enable the removal of AllowFPOpFusion. This had no test coverage
anyway.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+1-2llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+1-21 files

LLVM/project b4ec833llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-fpowi.mir legalize-fpow.mir

[AMDGPU] Carry the fpow expansion flags through its f32 round trip (#220681)

But do not carry ninf across the fpow round trip.
DeltaFile
+58-2llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fpow.mir
+5-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fpowi.mir
+64-43 files

LLVM/project 7ea47d1flang-rt/lib/cuda allocator.cpp

[flang][cuda] Unify locking regime for the allocation table (#221341)

The lock was acquired in insertAsyncDeviceAllocation but not in other
function. Move the lock outside of the function so the locking regime is
homogeneous.
DeltaFile
+2-1flang-rt/lib/cuda/allocator.cpp
+2-11 files

LLVM/project 6bfbb2eclang/docs ClangFormatStyleOptions.md, clang/include/clang/Format Format.h

[clang-format] Add FilesBeforeFolders option to SortIncludes (#208954)

Add a new `SortIncludes.FilesBeforeFolders` boolean option that, when
enabled, sorts includes so that files in a directory appear before
subdirectories at each level, recursively. Within a level, files and
subdirectories are each sorted alphabetically.

For example:

```
       true:                             false (default):
       #include "x.h"             vs.    #include "bar/alpha/e.h"
       #include "y.h"                    #include "bar/alpha/f.h"
       #include "z.h"                    #include "bar/beta/d.h"
       #include "bar/g.h"                #include "bar/g.h"
       #include "bar/h.h"                #include "bar/h.h"
       #include "bar/i.h"                #include "bar/i.h"
       #include "bar/alpha/e.h"          #include "foo/a.h"
       #include "bar/alpha/f.h"          #include "x.h"

    [4 lines not shown]
DeltaFile
+118-0clang/unittests/Format/SortIncludesTest.cpp
+42-6clang/lib/Format/Format.cpp
+24-1clang/include/clang/Format/Format.h
+23-0clang/docs/ClangFormatStyleOptions.md
+9-4clang/unittests/Format/ConfigParseTest.cpp
+216-115 files

LLVM/project 1315e04compiler-rt/lib/sanitizer_common sanitizer_common_interceptors.inc, compiler-rt/test/sanitizer_common/TestCases/Posix opendir_null.cpp

[memprof] check path in opendir interceptor (#221309)

The sanitizer `opendir` interceptor unconditionally calls
`internal_strlen(path)` before forwarding to the real function.
Passing `nullptr` therefore causes the sanitizer runtime itself to
dereference address zero.

Add a unit test using a `LD_PRELOAD` shim to verify that a null path
reaches the real implementation without crashing the interceptor.

---------

Co-authored-by: Sharon Xu <sharonxu at fb.com>
DeltaFile
+19-0compiler-rt/test/sanitizer_common/TestCases/Posix/opendir_null.cpp
+2-1compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+21-12 files

LLVM/project a0348d9flang/lib/Semantics resolve-names.cpp, flang/test/Lower/CUDA cuda-gpu-pinned2.f90

[flang][cuda] Make sure that CUDA is enabled when adding PINNED implicit attribute (#221334)

PINNED was not guarded like MANAGED. Just make a general guard for both.
DeltaFile
+11-10flang/lib/Semantics/resolve-names.cpp
+16-0flang/test/Lower/CUDA/cuda-gpu-pinned2.f90
+27-102 files

LLVM/project 3b0bb49compiler-rt/lib/sanitizer_common sanitizer_symbolizer_report.cpp, compiler-rt/test/ubsan/TestCases/Integer summary.cpp

[compiler-rt][ubsan] Fix trailing whitespace in SUMMARY line when function is unknown (#221335)

Fixes #30851. ReportErrorSummary always rendered "%L %F", but %F expands
to nothing when the function name is unknown, leaving a dangling space
at the end of the line. Instead, oly add the function name if it is
known.
DeltaFile
+2-2compiler-rt/test/ubsan/TestCases/Integer/summary.cpp
+1-1compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+3-32 files

LLVM/project 707bfbbllvm/lib/Target/ARM ARMInstrInfo.td ARMInstrNEON.td, llvm/test/CodeGen/ARM fp16-fusedMAC.ll fusedMAC.ll

ARM: Form fused VFMA/VFMS from the contract flag

Select the fused VFMA/VFMS/VFNMA/VFNMS from the per-node contract fast-math
flag instead of the global AllowFPOpFusion == Fast. This is one of the
few remaining consumers of the TargetOption field.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+132-30llvm/test/CodeGen/ARM/cortex-a57-misched-vfma.ll
+107-28llvm/test/CodeGen/ARM/fusedMAC.ll
+22-26llvm/test/CodeGen/ARM/fp16-fusedMAC.ll
+22-22llvm/lib/Target/ARM/ARMInstrVFP.td
+13-11llvm/lib/Target/ARM/ARMInstrNEON.td
+19-0llvm/lib/Target/ARM/ARMInstrInfo.td
+315-1171 files not shown
+317-1237 files

LLVM/project b84b2d7llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 minbw-node-used-twice.ll minbitwidth-icmp-mixed-extends.ll

[SLP]Fix narrowing of icmp with mismatched operand extensions

Keep the narrow compare only if the predicate matches the operand
signedness; otherwise extend the operands back to the original
compared type.

Fixes #221240

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/221336
DeltaFile
+44-7llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+13-5llvm/test/Transforms/SLPVectorizer/X86/minbitwidth-icmp-mixed-extends.ll
+1-1llvm/test/Transforms/SLPVectorizer/X86/minbw-node-used-twice.ll
+58-133 files

LLVM/project f94b3d1llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 pr48727.ll vector-fshr-rot-128.ll

[X86] combineX86ShuffleChain - only fold to truncate(concat(v1,v2)) if the concat is free (#221280)

Ensure we don't increase the shuffle chain depth
DeltaFile
+8-50llvm/test/CodeGen/X86/vector-trunc-nowrap.ll
+4-25llvm/test/CodeGen/X86/vector-trunc.ll
+13-9llvm/lib/Target/X86/X86ISelLowering.cpp
+6-6llvm/test/CodeGen/X86/vector-fshr-rot-128.ll
+3-3llvm/test/CodeGen/X86/pr48727.ll
+34-935 files

LLVM/project d69cde1llvm/test/Transforms/SLPVectorizer/X86 minbitwidth-icmp-mixed-extends.ll

[SLP][NFC]Add a test with incorrect comparison after vectorization, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/221332
DeltaFile
+346-0llvm/test/Transforms/SLPVectorizer/X86/minbitwidth-icmp-mixed-extends.ll
+346-01 files

LLVM/project f1e6b2ellvm/test/Transforms/LoopVectorize induction-cost.ll

[VPlan] Extend induction cost test coverage (NFC). (#221323)

Widen induction-cost.ll's filter to cover all induction recipes and the
canonical IV increment, run it for two VFs, and add the FP and pointer
induction shapes it was missing entirely: scalarized
FAdd/FSub/invariant-step inductions, a dead induction in the vector
loop, one with both wide and scalar users, one inside a replicate
region, a fully unrolled one, and FP-plus-pointer and pointer-only
loops.
DeltaFile
+448-31llvm/test/Transforms/LoopVectorize/induction-cost.ll
+448-311 files

LLVM/project a65128ellvm/lib/CodeGen/SelectionDAG LegalizeVectorTypes.cpp

[DAG] SplitVecRes_VECTOR_COMPRESS - rename MaskVT -> LoMaskVT. NFC. (#221285)

MaskVT refers to LoMask's type not the original Mask type.

Noticed in #215772 - avoids some potential Wshadow confusion.
DeltaFile
+6-6llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+6-61 files

LLVM/project c921457clang/lib/Driver/ToolChains AMDGPU.cpp, clang/lib/Headers/llvm_offload_wrappers/gpu __clang_gpu_libclc_declares.h __clang_gpu_math.h

add libclc math declarations
DeltaFile
+244-0clang/test/CodeGenCUDA/offload_via_llvm_math.cu
+212-0clang/lib/Headers/llvm_offload_wrappers/gpu/__clang_gpu_math.h
+164-0clang/lib/Headers/llvm_offload_wrappers/gpu/__clang_gpu_libclc_declares.h
+107-0offload/test/offloading/language/math.cpp
+35-0clang/test/Driver/llvmoffload-libclc.c
+7-5clang/lib/Driver/ToolChains/AMDGPU.cpp
+769-57 files not shown
+804-1213 files

LLVM/project ca1d8a8clang/lib/Headers __clang_gpu_builtin_vars.h CMakeLists.txt, clang/lib/Headers/llvm_offload_wrappers/gpu __clang_gpu_intrinsics.h __clang_gpu_device_functions.h

unify -foffload-via-llvm wrappers
DeltaFile
+0-358clang/lib/Headers/__clang_gpu_device_functions.h
+358-0clang/lib/Headers/llvm_offload_wrappers/gpu/__clang_gpu_device_functions.h
+0-230clang/lib/Headers/__clang_gpu_intrinsics.h
+230-0clang/lib/Headers/llvm_offload_wrappers/gpu/__clang_gpu_intrinsics.h
+55-28clang/lib/Headers/CMakeLists.txt
+0-62clang/lib/Headers/__clang_gpu_builtin_vars.h
+643-67817 files not shown
+867-85623 files

LLVM/project e0cfbdeoffload/test/offloading/CUDA blocking_stream_semantics.cu, offload/test/offloading/HIP blocking_stream_semantics.hip

unify tests
DeltaFile
+0-131offload/test/offloading/CUDA/blocking_stream_semantics.cu
+129-0offload/test/offloading/language/blocking_stream_semantics.cpp
+0-125offload/test/offloading/HIP/blocking_stream_semantics.hip
+106-0offload/test/offloading/language/stream_api.cpp
+102-0offload/test/offloading/language/get_errs.cpp
+100-0offload/test/offloading/language/devicesync_streams.cpp
+437-25646 files not shown
+1,112-1,94752 files

LLVM/project 75c0391llvm/lib/Transforms/Vectorize VPlanUtils.cpp, llvm/test/Transforms/LoopVectorize interleave-and-scalarize-only.ll replace-first-order-recurrence-by-versioned-iv.ll

[VPlan] Preserve nneg when expanding SCEVZeroExtendExpr. (#221322)

Add nneg to ZExt when expanding a SCEV where SCEV can prove it is
non-negative, matching behavior of IR SCEVExpander::visitZeroExtendExpr.
DeltaFile
+6-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+2-2llvm/test/Transforms/LoopVectorize/replace-first-order-recurrence-by-versioned-iv.ll
+2-2llvm/test/Transforms/LoopVectorize/reduction.ll
+2-2llvm/test/Transforms/LoopVectorize/AArch64/fold-tail-low-trip-count.ll
+1-1llvm/test/Transforms/LoopVectorize/interleave-and-scalarize-only.ll
+1-1llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-no-dotprod.ll
+14-96 files

LLVM/project ec0766foffload/languages/include/kernel LanguageRuntime.h, offload/languages/kernel/src LanguageRuntime.cpp

add Memset
DeltaFile
+87-0offload/test/offloading/CUDA/memset.cu
+85-0offload/test/offloading/HIP/memset.hip
+15-0offload/languages/kernel/src/LanguageRuntime.cpp
+1-2offload/test/offloading/HIP/basic_launch_blocks_and_threads.hip
+1-2offload/test/offloading/CUDA/basic_launch_blocks_and_threads.cu
+2-0offload/languages/include/kernel/LanguageRuntime.h
+191-42 files not shown
+193-48 files

LLVM/project 4f93033offload/languages/kernel/src LanguageRuntime.cpp, offload/test/offloading/CUDA devicesync_streams.cu

add proper deviceSync
DeltaFile
+98-0offload/test/offloading/CUDA/devicesync_streams.cu
+97-0offload/test/offloading/HIP/devicesync_streams.hip
+13-7offload/languages/kernel/src/LanguageRuntime.cpp
+1-1offload/test/offloading/HIP/launch_tu.hip
+1-1offload/test/offloading/HIP/basic_launch_multi_arg.hip
+1-1offload/test/offloading/HIP/basic_launch_blocks_and_threads.hip
+211-107 files not shown
+218-1313 files

LLVM/project 3a96f29libc/utils cmake_format_test.py cmake_format.py

[libc] Add CMake formatting utility (#213102)

Added libc/utils/cmake_format.py and libc/utils/cmake_format_test.py to
format LLVM and subproject CMake files according to LLVM-libc formatting
conventions.

The formatter operates in three passes:

* Lexer: Tokenises input using the cmake-language(7) EBNF specification
into typed Token objects with line and column position tracking.
* Dynamic Schema Scanner: Pre-scans repository CMake modules and
function blocks to learn option, single-value, and multi-value keyword
argument schemas from cmake_parse_arguments and set calls.
* Token-Stream Formatter: Applies 2-space control block nesting, keyword
casing, comment buffering, and multi-line list indentation in a single
pass.

The utility supports parallel multi-core execution (-j/--jobs) and
in-place file formatting (-i/--inplace). Added 44 unit tests covering

    [2 lines not shown]
DeltaFile
+1,534-0libc/utils/cmake_format.py
+507-0libc/utils/cmake_format_test.py
+2,041-02 files

LLVM/project 46b146dclang/lib/CIR/CodeGen CIRGenFunction.cpp, clang/test/CIR/CodeGen paren-list-agg-init.cpp delegating-ctor.cpp

[CIR] Emit Memset in emitNullInitialization for default inits case (#221029)

Emit the cir.libc.memset op in emitNullInitialization for the default
inits case, which ends up with emitted IR identical to the original
codegen and eliminates the need to create a private global instance of a
struct with zero init
DeltaFile
+22-10clang/test/CIR/CodeGen/new.cpp
+19-9clang/test/CIR/CodeGen/implicit-value-init-expr.cpp
+14-9clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+6-3clang/test/CIR/CodeGen/delegating-ctor.cpp
+6-3clang/test/CIR/CodeGen/agg-atomic-cast.c
+5-2clang/test/CIR/CodeGen/paren-list-agg-init.cpp
+72-366 files

LLVM/project c767b13llvm/lib/Target/Mips MipsInstrInfo.td MipsSEISelLowering.cpp, llvm/test/CodeGen/Mips fp-contract.ll

Mips: Drop use of AllowFPOpFusion

Fuse MSA fmadd/fmsub based on the contract flag. Fix a few
places dropping the flags during legalization.

The handling here of fusion isn't ideal. isFMAFasterThanFMulAndFAdd
is not implemented, so these patterns are doing a lot heavier and
less optimal work than the DAGCombiner logic will do.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+40-14llvm/test/CodeGen/Mips/fp-contract.ll
+8-8llvm/lib/Target/Mips/MipsMSAInstrInfo.td
+3-6llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+0-7llvm/lib/Target/Mips/MipsInstrInfo.td
+51-354 files

LLVM/project c3fa882llvm/test/CodeGen/NVPTX fma.ll fma-relu-contract.ll

NVPTX: Drop global AllowFPOpFusion read from allowFMA (#221313)

We're near the end of the decade long effort to eliminate the
fast math fields from TargetOptions. This is one of the few
remaining consumers, so remove it. Update incidentally
changed tests by adding contract flags.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+27-58llvm/test/CodeGen/NVPTX/fp-contract.ll
+41-43llvm/test/CodeGen/NVPTX/fma-assoc.ll
+25-54llvm/test/CodeGen/NVPTX/fp-contract-f32x2.ll
+29-29llvm/test/CodeGen/NVPTX/scalarize-non-coalescable-v2f32.ll
+21-21llvm/test/CodeGen/NVPTX/fma-relu-contract.ll
+12-12llvm/test/CodeGen/NVPTX/fma.ll
+155-2173 files not shown
+169-2359 files

LLVM/project d4aa8a9llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, mlir/test/Target/LLVMIR omptarget-debug-runtime-call-loc.mlir

[OMPIRBuilder] Keep the target construct's location for the deinit call (#221303)

#217407 gave __kmpc_target_init and __kmpc_target_deinit a debug
location by setting the outlined function's location once, before
generating the target body. The init call is emitted before the body and
keeps it, but the deinit call is emitted after, and by then the body may
have replaced it.

The body callback builds the body with its own IRBuilder, so nothing it
emits can disturb the one createOutlinedFunction() uses for the
epilogue. But a body holding another OpenMP construct, a nested parallel
say, calls OpenMPIRBuilder::createParallel, and that leaves the builder
pointing at the wrong debug location, or at none at all. The deinit call
then silently loses its !dbg again.

The test added with #217407 uses a target region whose body is a single
store. Such a body never calls back into OpenMPIRBuilder, the location
survives, and the gap was not visible.


    [8 lines not shown]
DeltaFile
+45-1mlir/test/Target/LLVMIR/omptarget-debug-runtime-call-loc.mlir
+8-0llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+53-12 files

LLVM/project 9377616llvm/cmake/modules CrossCompile.cmake

[cmake] Fix ninja clean failure for cross-compilation native build dir (#200641)

Ninja clean treats every build OUTPUT as a path to remove(). When NATIVE
(the cross-compilation host sub-build directory) was registered directly
as the OUTPUT of the CREATE_<project>_<target> custom command, ninja
tried to remove() it as if it were a file and failed with "Directory not
empty".

Fixed by introducing a stamp file (NATIVE/created.stamp) as the sole
CMake OUTPUT of that custom command. The stamp file is what ninja cleans
(a single file removal), while make_directory remains idempotent on
subsequent builds.
DeltaFile
+5-2llvm/cmake/modules/CrossCompile.cmake
+5-21 files

LLVM/project f0c26dcllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 logical-reduction-booleanized-leaves.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+16-127llvm/test/Transforms/SLPVectorizer/X86/logical-reduction-booleanized-leaves.ll
+89-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+105-1292 files

LLVM/project c5ce451clang-tools-extra/include-cleaner/lib WalkAST.cpp, clang-tools-extra/include-cleaner/unittests WalkASTTest.cpp

[include-cleaner] Support Objective-C toll-free bridged casts (#216158)

Handle `CK_CPointerToObjCPointerCast` in `WalkAST` to report implicit
case when converting id/void to an Objective-C type (non-arc only). Also
adds unit tests for various bridged cast types (these were already
covered, but this verifies that they work).
DeltaFile
+117-0clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
+45-40clang-tools-extra/include-cleaner/lib/WalkAST.cpp
+162-402 files

LLVM/project 330b49fllvm/test/Transforms/LoopVectorize/VPlan memory-checks.ll

[LV] Add VPlan printing tests for memory runtime check generation (NFC) (#221232)

Add VPlan printing tests with runtime check blocks, as well as coverage
for checks where one of the bounds involves an AddRec.
DeltaFile
+266-0llvm/test/Transforms/LoopVectorize/VPlan/memory-checks.ll
+266-01 files

LLVM/project d58de5dllvm/utils/lit/lit main.py, llvm/utils/lit/lit/formats googletest.py

[lit] Apply --filter-out to GoogleTest shard results (#220410)

[lit] Apply --filter-out to tests expanded from GoogleTest shards

A GoogleTest shard is a single lit test at discovery time, so
`--filter-out` can only match the shard's name and has no way to
deselect individual gtest cases. The cases only get real names once
`post_process_shard_results` expands the shard's JSON output.

Apply the filter there instead: mark expanded subtests whose full name
matches `--filter-out` as EXCLUDED. Record `has_failure_in_shard` before
the filter is applied, so a shard whose only failing cases were filtered
out is still considered accounted for and is not additionally reported as
a failure of the parent shard.

Add a test which filters out the failing and unresolved cases of the
googletest-format inputs and checks that the run reports 2 excluded
and no failures.

Assisted-By: Claude Opus 5.
DeltaFile
+13-3llvm/utils/lit/lit/formats/googletest.py
+12-0llvm/utils/lit/tests/googletest-filter-out.py
+1-1llvm/utils/lit/lit/main.py
+26-43 files

LLVM/project de937f1offload/languages/kernel/include Stream.h LanguageUtils.h, offload/languages/kernel/src State.cpp LanguageLaunch.cpp

add event cleanup
DeltaFile
+83-0offload/languages/kernel/src/Stream.cpp
+42-26offload/languages/kernel/include/LanguageUtils.h
+19-23offload/languages/kernel/src/LanguageRuntime.cpp
+19-0offload/languages/kernel/include/Stream.h
+7-8offload/languages/kernel/src/LanguageLaunch.cpp
+6-2offload/languages/kernel/src/State.cpp
+176-592 files not shown
+179-608 files