LLVM/project 97e24c8clang/test/CIR/CodeGenBuiltins builtin-isfpclass.c builtin-fpclassify.c

[CIR] Fix lit tests after is.fpclass pretty printing. NFC (#209026)
DeltaFile
+36-36clang/test/CIR/CodeGenBuiltins/builtin-isfpclass.c
+20-20clang/test/CIR/CodeGenBuiltins/builtin-fpclassify.c
+1-1clang/test/CIR/CodeGenBuiltins/builtin-isinf-sign.c
+57-573 files

LLVM/project 7206149clang/unittests/Lex PPMemoryAllocationsTest.cpp

[NFC][clang] Adjust PPMemoryAllocationsTest threshold for ASan (#209024)

PPMemoryAllocationsTest.PPMacroDefinesAllocations measures the memory
footprint of the preprocessor allocator and asserts a strict threshold
of 130.0 bytes per define.

When built with ASan, the allocator adds redzones to allocations,
which increases the total memory reported by `getTotalMemory()` and
causes the test to fail (reporting ~136.8 bytes per define).

Adjust the threshold to 145.0 bytes per define when built with ASan
(detected via `LLVM_ADDRESS_SANITIZER_BUILD`) to account for this
overhead while maintaining the strict limit for standard builds.

Assisted-by: Gemini
DeltaFile
+5-0clang/unittests/Lex/PPMemoryAllocationsTest.cpp
+5-01 files

LLVM/project 21bc0e9offload/test/offloading xteam_reduction_default_grid.c

add test
DeltaFile
+61-0offload/test/offloading/xteam_reduction_default_grid.c
+61-01 files

LLVM/project 722c78aclang/unittests/Lex PPMemoryAllocationsTest.cpp

format

Created using spr 1.3.7
DeltaFile
+1-1clang/unittests/Lex/PPMemoryAllocationsTest.cpp
+1-11 files

LLVM/project d377eafclang/unittests/Lex PPMemoryAllocationsTest.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+5-0clang/unittests/Lex/PPMemoryAllocationsTest.cpp
+5-01 files

LLVM/project a259ffbllvm/test/Transforms/SLPVectorizer/X86 minmax-main-opcode-copyables.ll minmax-main-opcode-copyables-cost.ll

[SLP][NFC]Add tests for copyables in minmax int intrinsics, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/209021
DeltaFile
+158-0llvm/test/Transforms/SLPVectorizer/X86/minmax-main-opcode-copyables.ll
+32-0llvm/test/Transforms/SLPVectorizer/X86/minmax-main-opcode-copyables-cost.ll
+190-02 files

LLVM/project d38cd84llvm/test/Transforms/SLPVectorizer/X86 minmax-main-opcode-copyables.ll minmax-main-opcode-copyables-cost.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+158-0llvm/test/Transforms/SLPVectorizer/X86/minmax-main-opcode-copyables.ll
+32-0llvm/test/Transforms/SLPVectorizer/X86/minmax-main-opcode-copyables-cost.ll
+190-02 files

LLVM/project 7c2f4dborc-rt/lib/executor Environment.cpp Environment.h

[orc-rt] Add internal secureGetenv utility and use it in the printf b… (#209014)

…ackend

orc_rt::secureGetenv is like getenv, but returns null when the process
is running with elevated privileges (e.g. a set-user-ID or set-group-ID
program), so that a variable in an attacker-controlled environment
cannot influence a privileged host. On libcs where privilege can't be
checked (anything other than glibc or the BSDs/macOS), it fails secure
and returns null, so those environment variables are ignored until a
branch for the platform is added.

Switch the printf logging backend to read ORC_RT_LOG and
ORC_RT_LOG_OUTPUT through secureGetenv, so a redirected log file or
level can't be forced via the environment in a privileged process.

Note that running the ORC runtime in a process with elevated privileges
is extremely risky (since the JIT'd code will typically inherit these
elevated privileges), and expected to be rare. Exercise extreme caution
with such setups.
DeltaFile
+52-0orc-rt/lib/executor/Environment.cpp
+28-0orc-rt/lib/executor/Environment.h
+4-5orc-rt/lib/executor/Logging_printf.cpp
+1-0orc-rt/lib/executor/CMakeLists.txt
+85-54 files

LLVM/project 8c7ea2fllvm/lib/Analysis ScalarEvolution.cpp, llvm/unittests/Analysis ScalarEvolutionTest.cpp

Revert "[SCEV] Speed up forgetLoop by avoiding def-use walk for loop-header P…"

This reverts commit 0411e39a35866c125750810e59a15e00c9484fc9.
DeltaFile
+0-39llvm/unittests/Analysis/ScalarEvolutionTest.cpp
+16-6llvm/lib/Analysis/ScalarEvolution.cpp
+16-452 files

LLVM/project 1aa1cbdlldb/include/lldb/Host JSONTransport.h

[LLDB] Fix use-after-free destroying a Binder from its OnClosed handler

transport::Binder::OnClosed() holds m_mutex (a recursive_mutex) while
invoking m_disconnect_handler. In the MCP server, that handler removes
the disconnected client, which owns the transport and therefore the
Binder itself. As a result, the Binder -- and its m_mutex -- are
destroyed while the scoped_lock in OnClosed still holds the lock.

This is a use-after-free everywhere, as the lock guard later unlocks
freed memory.

Move the disconnect handler out of the critical section and release the
lock before invoking it, so the Binder can be safely destroyed without
holding or destroying a locked mutex.
DeltaFile
+12-3lldb/include/lldb/Host/JSONTransport.h
+12-31 files

LLVM/project f99f2a5clang/include/clang/StaticAnalyzer/Checkers Checkers.td, clang/lib/StaticAnalyzer/Checkers UseAfterLifetimeEnd.cpp LifetimeModeling.cpp

[analyzer] Implement LifetimeModeling checker and refactor UseAfterLifetimeEnd (#205951)
DeltaFile
+16-212clang/lib/StaticAnalyzer/Checkers/UseAfterLifetimeEnd.cpp
+214-0clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+18-0clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.h
+9-4clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+2-2clang/test/Analysis/lifetime-bound.cpp
+1-1clang/test/Analysis/debug-lifetime-bound.cpp
+260-2191 files not shown
+261-2197 files

LLVM/project b82a9a5llvm/benchmarks ImmutableSetBuildBM.cpp CMakeLists.txt, llvm/include/llvm/ADT ImmutableSet.h

[ADT] Fuse the two post-mutation tree walks in ImutAVLFactory (#208907)
DeltaFile
+75-0llvm/benchmarks/ImmutableSetBuildBM.cpp
+16-17llvm/include/llvm/ADT/ImmutableSet.h
+1-0llvm/benchmarks/CMakeLists.txt
+92-173 files

LLVM/project 3f2d8ebllvm/lib/Transforms/Utils BasicBlockUtils.cpp UnifyLoopExits.cpp, llvm/test/Transforms/FixIrreducible multiedge.ll

[FixIrreducible][UnifyLoopExits] Fix callbr multiedge splitting (#207598)

This fixes a bug where splitting `callbr` multiedges corrupts the
successor's PHI nodes.

Originally, the first split edge would replace all incoming edges from
the `callbr` block with the newly introduced target block by using
`replacePhiUsesWith`. Later edges would create new target blocks and
would try to update their edge's PHI as well, but would not find it,
leading to a corrupted PHI node.

To fix this, it is theoretically only necessary to ensure that exactly
one PHI argument is replaced per split edge. However, as all the PHI
nodes must have the same argument for every edge from one predecessor, a
single target block suffices, through which all traffic can be routed,
which will be especially useful for switches, where multiedges are
common.

[Trunk crashing](https://godbolt.org/z/4MM5eMrW5)

Found while working on PR #206567, cc @ro-i.
DeltaFile
+144-0llvm/test/Transforms/UnifyLoopExits/multiedge.ll
+95-0llvm/test/Transforms/FixIrreducible/multiedge.ll
+37-18llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+34-19llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
+18-4llvm/lib/Transforms/Utils/FixIrreducible.cpp
+1-3llvm/test/Transforms/UnifyLoopExits/basic.ll
+329-441 files not shown
+332-447 files

LLVM/project 0d86090lldb/source/Host/freebsd Host.cpp

[LLDB][FreeBSD] Fill pgid and sid in ProcessInfo

These two fields are required by HostTest.cpp. Although I don't see any
usecase, we add these two fields to prevent failure.
DeltaFile
+6-0lldb/source/Host/freebsd/Host.cpp
+6-01 files

LLVM/project 3187f26clang-tools-extra/clang-tidy/modernize UseStringViewCheck.cpp, clang-tools-extra/test/clang-tidy/checkers/modernize use-string-view.cpp

[clang-tidy] Modernize-use-string-view: fix todo for ternary (#209008)

Add a support for any-depth ternary expressions
DeltaFile
+19-1clang-tools-extra/test/clang-tidy/checkers/modernize/use-string-view.cpp
+13-4clang-tools-extra/clang-tidy/modernize/UseStringViewCheck.cpp
+32-52 files

LLVM/project a06b1c9orc-rt/include/orc-rt-c Logging.h, orc-rt/lib/executor Logging_printf.cpp

[orc-rt] Add printf logging backend (#209006)

Implement the printf backend, selected at configure-time with
ORC_RT_LOG_BACKEND=printf. Messages are written to stderr, or to the
file named by the ORC_RT_LOG_OUTPUT environment variable.

The ORC_RT_LOG environment variable sets the runtime level floor (error,
warning, info, debug, or off) -- only messages at or above it are shown.
When unset it defaults to warning, so warnings and errors are shown and
info and debug are opt-in. The runtime floor cannot go below the
compile-time ORC_RT_LOG_LEVEL floor (the lowest level built in).

Also add regression tests, driven by a new orc-rt-log-check tool that
reports the compiled-in backend and levels (which lit exposes as
features) and emits a message at each level.
DeltaFile
+122-0orc-rt/lib/executor/Logging_printf.cpp
+105-0orc-rt/test/tools/orc-rt-log-check.cpp
+51-3orc-rt/include/orc-rt-c/Logging.h
+44-5orc-rt/test/regression/lit.cfg.py
+13-0orc-rt/test/regression/logging/printf-backend/debug-level.test
+12-0orc-rt/test/regression/logging/printf-backend/runtime-level.test
+347-810 files not shown
+415-816 files

LLVM/project 97bceedllvm/lib/Target/RISCV RISCVISelLowering.cpp RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-zip.ll rvp-srl-bitcast-bv.ll

[RISCV][P-ext] Improve the codegen for unzip-like shuffle and buildvector (#208763)

This patch selects `pncvt*`/`unzip*` for unzip-like patterns.
On RV32, we select packed narrow shift for i8x4 and i16x2 BUILD_VECTOR
that are equivalent to deinterleave shuffle.
On RV64, we select packed unzip for i8x4 and i16x2 deinterleave shuffle.
Apart from the packed unzip intrinsics, this patch also adds support for
the codegen of two-source unzip.
DeltaFile
+173-32llvm/test/CodeGen/RISCV/rvp-zip.ll
+102-23llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+36-4llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+3-3llvm/test/CodeGen/RISCV/rvp-srl-bitcast-bv.ll
+314-624 files

LLVM/project a34cb57clang/lib/StaticAnalyzer/Checkers CStringChecker.cpp, clang/test/Analysis string-search-modeling.c

[analyzer] Model strchr/strrchr/memchr/strstr/strpbrk/strchrnul (#207267)

CStringChecker did not model these buffer-search functions, so the
engine bound each call to a fresh conjured symbol unrelated to the source.

As a consequence, we could not track the origin of the returned pointer,
thus the fact that it shares provenance of the source pointer.

Fixes #203260

Assisted-by: Claude Opus 4.8
DeltaFile
+178-0clang/test/Analysis/string-search-modeling.c
+79-4clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+257-42 files

LLVM/project 4c7948dllvm/lib/Transforms/Vectorize VPlanHelpers.h LoopVectorize.cpp

Revert "[VPlan] Re-use VPSlotTracker when printing recipes for costs (NFC)." (#209003)

Reverts llvm/llvm-project#203386.

This causes a large compile-time regression.
DeltaFile
+2-19llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+3-5llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+1-6llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+6-303 files

LLVM/project 4b74cbcllvm/lib/Transforms/Vectorize VPlanHelpers.h LoopVectorize.cpp

Revert "[VPlan] Re-use VPSlotTracker when printing recipes for costs (NFC). (…"

This reverts commit 030fdcef27fe29b5e2c1ef0c6c9df6050b51569a.
DeltaFile
+2-19llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+3-5llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+1-6llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+6-303 files

LLVM/project af812fcclang/lib/Headers riscv_packed_simd.h, clang/test/CodeGen/RISCV rvp-intrinsics.c

[Clang][RISCV][P-ext] Support packed widening convert intrinsics (#208394)

This patch implements all packed widening convert intrinsics using
general vector operations. Low widening conversions use
`__builtin_convertvector`, while high-half conversions use general
shuffles.

The generated code for high-half conversions is correct but not yet
optimal.
DeltaFile
+162-0clang/test/CodeGen/RISCV/rvp-intrinsics.c
+99-0llvm/test/CodeGen/RISCV/rvp-widening-convert.ll
+49-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+50-0cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+27-0clang/lib/Headers/riscv_packed_simd.h
+387-25 files

LLVM/project 25a5b78llvm/include/llvm/IR PatternMatch.h, llvm/lib/Analysis ValueTracking.cpp

[PatternMatch] Add capturing m_Phi matcher (NFC) (#208949)

Add a new capturing m_Phi matcher and use it in some patterns instead of
manually casting/checking if operand is a phi.

PR: https://github.com/llvm/llvm-project/pull/208949
DeltaFile
+4-11llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+6-8llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
+2-11llvm/lib/CodeGen/CodeGenPrepare.cpp
+4-4llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp
+2-4llvm/lib/Analysis/ValueTracking.cpp
+3-0llvm/include/llvm/IR/PatternMatch.h
+21-386 files

LLVM/project 0b85e1elldb/source/Plugins/Process/Utility InferiorCallPOSIX.cpp

Support Re-export Symbol for FunctionCall

A symbol can be a stub that is re-exported to another library. For
example, ELF can specify an auxiliary library and emit a zero-sized
symbol in the symbol table. This can cause expression evaluation to
resolve the stub instead of the actual function. Fix this by resolving
re-exported symbols to their actual addressed.
DeltaFile
+28-6lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+28-61 files

LLVM/project 0f6e6fdlldb/unittests/ObjectFile/ELF TestObjectFileELF.cpp, lldb/unittests/Target ReExportedSymbolTest.cpp CMakeLists.txt

Add unit tests for ELF filter-library symbol handling.

* ObjectFileELFTest.FilterLibraryPlaceholderSymbols: a yaml2obj ELF
  filter library with two DT_AUXILIARY entries checks that
  GetReExportedLibraries() returns the filtees in dynamic-section
  order, that zero-sized exported functions become re-exported symbols
  recording the first filtee and the unversioned name (@VERSION suffix
  stripped), and that nonzero-sized and local definitions are left
  alone.

* ReExportedSymbolTest.ResolveThroughFilteesInOrder: a target holding
  a filter library and two filtee modules checks that
  Symbol::ResolveReExportedSymbol finds a definition in the first
  filtee via the library recorded on the symbol, continues to the next
  filtee in declaration order for symbols the first filtee lacks, and
  that without the containing module only the recorded library is
  searched.

Co-Authored-By: Claude Fable 5 <noreply at anthropic.com>
DeltaFile
+269-0lldb/unittests/Target/ReExportedSymbolTest.cpp
+121-0lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
+1-0lldb/unittests/Target/CMakeLists.txt
+391-03 files

LLVM/project e62c0cbclang/lib/AST/ByteCode Compiler.cpp Pointer.cpp, clang/test/PCH cxx20-template-args.cpp

[clang][bytecode] Fix comparing `TemplateParamObjectDecl`s (#208734)

1) When creating the global variables for them, always use the first
decl
2) When converting null pointers to `APValue`, don't cast the nullptr
base to `Expr` or `ValueDecl`. Use `LValueBase()` instead, so the
internal `PointerUnion` has an all-zeros value as `getOpaqueValue()`. If
we don't do this, we run into problems with merging of
`TemplateParamObjectDecls` because they don't compare equal via
`::Profile()`.
DeltaFile
+5-2clang/lib/AST/ByteCode/Compiler.cpp
+1-1clang/lib/AST/ByteCode/Pointer.cpp
+1-0clang/test/PCH/cxx20-template-args.cpp
+7-33 files

LLVM/project 31ae997lldb/unittests/ObjectFile/ELF TestObjectFileELF.cpp, lldb/unittests/Target ReExportedSymbolTest.cpp CMakeLists.txt

Add unit tests for ELF filter-library symbol handling.

* ObjectFileELFTest.FilterLibraryPlaceholderSymbols: a yaml2obj ELF
  filter library with two DT_AUXILIARY entries checks that
  GetReExportedLibraries() returns the filtees in dynamic-section
  order, that zero-sized exported functions become re-exported symbols
  recording the first filtee and the unversioned name (@VERSION suffix
  stripped), and that nonzero-sized and local definitions are left
  alone.

* ReExportedSymbolTest.ResolveThroughFilteesInOrder: a target holding
  a filter library and two filtee modules checks that
  Symbol::ResolveReExportedSymbol finds a definition in the first
  filtee via the library recorded on the symbol, continues to the next
  filtee in declaration order for symbols the first filtee lacks, and
  that without the containing module only the recorded library is
  searched.

Co-Authored-By: Claude Fable 5 <noreply at anthropic.com>
DeltaFile
+269-0lldb/unittests/Target/ReExportedSymbolTest.cpp
+121-0lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
+1-0lldb/unittests/Target/CMakeLists.txt
+391-03 files

LLVM/project 9c2bb1alldb/include/lldb/Symbol Symbol.h, lldb/source/Plugins/ObjectFile/ELF ObjectFileELF.cpp ObjectFileELF.h

[LLDB] Support Auxiliary library in ELF format

An ELF filter library (DT_FILTER) or auxiliary filter (DT_AUXILIARY)
delegates symbol resolution to its filtee: the dynamic linker looks up
each symbol in the filtee first, falling back to the filter library's
own definition. Filter library may export placeholder smyolbs whose
addresses are not the actual function entry points.

To support this, we teach ObjectFileELF to parse the filtee and model
placeholder function definition in filter libraries as ReExported,
reusing the existing re-export machinery.

Notice that in ELF, we don't record the per-symbol target ReExported
library like Macho. Instead, it is a suggestion list from the libraries
that exposes this symbol. As a result, we need to pass the library
Module to read the suggestion list to correctly parse the file in
Resolver.
DeltaFile
+43-10lldb/source/Symbol/Symbol.cpp
+31-0lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+11-1lldb/include/lldb/Symbol/Symbol.h
+2-0lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+87-114 files

LLVM/project 2aab895clang/test/CodeGen arm_neon_intrinsics.c cx-complex-range.c, clang/test/CodeGen/AArch64 neon-intrinsics.c

[SROA] Use constant 64-bit indices for Extract/InsertElement (#208918)

The canonical form preferred by instCombine is to use 64-bit values for
constant index in ExtractElement and InsertElement.
DeltaFile
+790-790clang/test/CodeGen/arm_neon_intrinsics.c
+218-218clang/test/CodeGen/cx-complex-range.c
+216-216clang/test/CodeGen/arm-neon-vst.c
+147-147clang/test/CodeGen/AArch64/neon/intrinsics.c
+113-113clang/test/CodeGen/AArch64/neon-intrinsics.c
+104-104llvm/test/Transforms/SROA/vector-promotion.ll
+1,588-1,58822 files not shown
+1,823-1,82528 files

LLVM/project 7215a1allvm/test/Transforms/LoadStoreVectorizer/AMDGPU merge-stores.ll, llvm/test/Transforms/LoadStoreVectorizer/NVPTX load-store-256-bit.ll vectorize_i8.ll

[LoadStoreVectorizer] Use constant 64-bit indices for Extract/InsertElement (#208941)

The canonical form preferred by instCombine is to use 64-bit values for
constant index in ExtractElement and InsertElement.
DeltaFile
+305-304llvm/test/Transforms/LoadStoreVectorizer/NVPTX/load-store-256-bit.ll
+138-138llvm/test/Transforms/LoadStoreVectorizer/NVPTX/vectorize_i8.ll
+80-80llvm/test/Transforms/LoadStoreVectorizer/NVPTX/masked-store.ll
+78-78llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/merge-stores.ll
+50-50llvm/test/Transforms/LoadStoreVectorizer/X86/vectorize-i8-nested-add.ll
+40-40llvm/test/Transforms/LoadStoreVectorizer/NVPTX/gap-fill.ll
+691-69025 files not shown
+932-93331 files

LLVM/project 76f0d46lld/test/ELF aarch64-reloc-pauth.s pack-dyn-relocs-relr-loop.s

[ELF,test] Improve .relr.auth.dyn -> .rela.dyn movement coverage (#208991)

Test two behaviors of #195649 that were unasserted:

- .dynamic shrinks when all .relr.auth.dyn entries are moved to a
  non-empty .rela.dyn. Check the section header size: readelf -d stops
  at the first DT_NULL and cannot show stale padding. This subsumes
  empty-relr.s (a size-neutral tag swap, which passed even without the
  fix), so remove it.
- An empty .rela.dyn is removed when .relr.auth.dyn is unused. Assert
  this in pack-dyn-relocs-relr-loop.s.
DeltaFile
+40-54lld/test/ELF/aarch64-reloc-pauth.s
+2-0lld/test/ELF/pack-dyn-relocs-relr-loop.s
+42-542 files