LLVM/project 2de67c3llvm/lib/Target/AArch64 AArch64MIPeepholeOpt.cpp, llvm/test/CodeGen/AArch64 peephole-insert-subreg.mir peephole-insvigpr.mir

[AArch64] Clear kill flags from visitINSvi64lane (#209096)

If we replace a reg, we can have more uses meaning the kill flags are no
longer
valid. Make sure we remove them in case.
DeltaFile
+46-0llvm/test/CodeGen/AArch64/peephole-insert-subreg.mir
+2-2llvm/test/CodeGen/AArch64/peephole-insvigpr.mir
+2-0llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
+50-23 files

LLVM/project 32f3f9dllvm/test/Transforms/SLPVectorizer/X86 propagate_ir_flags.ll

[SLP][NFC] Pre-commit tests for select IR-flag/metadata propagation (#208150)

Pre-commits regression tests for an upcoming SLPVectorizer fix (see
#207982). These IR shapes are currently vectorized by SLP, and the
vectorization is functionally correct but when a bundle of
scalar`select` instructions is vectorized, the resulting vector `select`
drops the fast-math flags (and other IR flags/metadata such as
`!unpredictable`) that were common to every scalar lane.

This NFC patch records the current (buggy) behavior so that the
follow-up fix's diff is limited to the behavioural change: `select_nnan`
currently loses `nnan` on the vectorized select, while
`select_not_all_nnan` (one lane missing `nnan`) correctly has none.

Co-authored-by: Ayush Rai <Ayush.Rai at amd.com>
DeltaFile
+70-0llvm/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll
+70-01 files

LLVM/project 56e62e5llvm/lib/Target/WebAssembly WebAssemblyInstrSIMD.td WebAssemblyISelLowering.cpp, llvm/test/CodeGen/WebAssembly simd-relaxed-fmax.ll simd-relaxed-fmin.ll

[WebAssembly] Use generic pseudo_fmin/pseudo_fmax opcodes (#208454)

The pmin/pmax instructions are equivalent to these with operands
swapped.

The existing matching code for these instructions was incorrect, because
it failed to handle signed zeros and NaNs properly. You can't treat
strict and non-strict comparisons the same in this context.
DeltaFile
+48-24llvm/test/CodeGen/WebAssembly/simd-relaxed-fmax.ll
+44-20llvm/test/CodeGen/WebAssembly/simd-relaxed-fmin.ll
+7-20llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+8-8llvm/test/CodeGen/WebAssembly/simd-arith.ll
+8-8llvm/test/CodeGen/WebAssembly/vector-reduce.ll
+4-0llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+119-806 files

LLVM/project 2119e35lld/ELF LinkerScript.cpp, lld/test/ELF gnu-build-attributes.s

[lld][ELF] Concatenate .gnu.build.attributes.* sections (#208737)

ld.bfd/ld.gold have been concatenating the GNU build attribute sections
since 2018:

https://gitlab.com/gnutools/binutils-gdb/-/commit/7d8a31665739412395f6dd370d2279acd322e78e

Do the same in LLD. These do not have a dedicated section type or flags,
so this is handled by the name-based logic. (Peculiarly, there used to
be SHF_GNU_BUILD_NOTE, but it was removed again.)

Not concatenating these results in a huge number of sections, which
breaks tools like `file`.
DeltaFile
+42-0lld/test/ELF/gnu-build-attributes.s
+1-1lld/ELF/LinkerScript.cpp
+43-12 files

LLVM/project f97cdc4llvm/lib/Target/PowerPC PPC.td PPCTargetTransformInfo.cpp, llvm/test/Transforms/Inline/PowerPC inline-target-attr.ll

[PowerPC] Specify inlining behavior in TableGen (#206938)

Remove the custom areInlineCompatible() implementation and specify the
inlining behavior in TableGen instead.

I've tried to classify these to the best of my ability. Most features
stay at InlineDefault with the usual "caller can have more features than
callee" semantics. Tuning features are InlineIgnore. This includes all
the directive features, which, as far as I can tell, are only used for
tuning heuristics.

I also marked a few InlineMustMatch/InlineInverse, though I'm not
particularly confident on which ones are required to match.
DeltaFile
+49-42llvm/lib/Target/PowerPC/PPC.td
+0-14llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+3-3llvm/test/Transforms/Inline/PowerPC/inline-target-attr.ll
+0-2llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
+52-614 files

LLVM/project ca970f3llvm/lib/Transforms/Vectorize VPlanUtils.cpp, llvm/test/Transforms/LoopVectorize simplify-reverse-reverse.ll

[VPlan] Simplify reverses through unary ops (fneg) (#208257)

By marking fneg as elementwise
DeltaFile
+1-3llvm/test/Transforms/LoopVectorize/simplify-reverse-reverse.ll
+1-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+2-42 files

LLVM/project fb8c7daclang/include/clang/Basic TokenKinds.h IdentifierTable.h

[clang][NFC] move TokenKey to TokenKinds.h (#208867)

This patch moves the `TokenKey` enum closer to where it's actually used.
This is in preparation to generate it from tablegen once the definition
has been moved.
DeltaFile
+38-0clang/include/clang/Basic/TokenKinds.h
+0-38clang/include/clang/Basic/IdentifierTable.h
+38-382 files

LLVM/project a0f9801llvm/lib/Target/RISCV RISCVMacroFusion.td, llvm/test/CodeGen/RISCV xqci-macro-fusions.mir features-info.ll

[RISCV] Fuse QC_E_LI to Loads/Store (#208134)

The QC Access relocations require the `qc.e.li` to be adjacent to its
load/store. This ensures that happens, and allows more relaxation
opportunities.
DeltaFile
+140-0llvm/test/CodeGen/RISCV/xqci-macro-fusions.mir
+12-0llvm/lib/Target/RISCV/RISCVMacroFusion.td
+1-0llvm/test/CodeGen/RISCV/features-info.ll
+153-03 files

LLVM/project 2bcb848orc-rt/include/orc-rt-c Logging.h

[orc-rt] Require ORC_RT_LOG format strings to be string literals (#209090)

os_log needs the format string as a literal (it builds format metadata
at the call site), while the none and printf backends accept a runtime
const char*. That mismatch let a non-literal format compile on
none/printf and fail only on an os_log build. Enforce the literal
requirement uniformly in the ORC_RT_LOG macro via an unevaluated
sizeof("" ...) check, so it is caught at the call site on every backend.
DeltaFile
+10-1orc-rt/include/orc-rt-c/Logging.h
+10-11 files

LLVM/project 6e7afc1orc-rt/include/orc-rt-c Logging.h

[orc-rt] Remove doxygen comments from logging implemenetation APIs (#209086)

These APIs are intended for internal consumption by the ORC runtime's
logging system: plain comments are more appropriate here than doxygen
comments.
DeltaFile
+2-2orc-rt/include/orc-rt-c/Logging.h
+2-21 files

LLVM/project 3f80df8llvm/test/tools/llvm-profgen recursion-compression-pseudoprobe.test, llvm/test/tools/llvm-profgen/Inputs cs-preinline-cost.perfscript truncated-pseudoprobe.ll

[llvm-profgen][test] Split tests by target architecture (#207724)

The top-level llvm-profgen lit configuration previously disabled the
entire test directory unless the X86 target was registered. As a result,
target-independent tests and tests for ARM and AArch64 also implicitly
depended on X86.

Split target-specific tests and inputs into X86, ARM, and AArch64
directories with per-directory lit.local.cfg files. Leave help.test at
the top level because it is target-independent. Existing X86 tests
remain guarded by X86 and run as before, while ARM and AArch64 tests no
longer require the X86 target. The X86 non-ARM ETM rejection case also
no longer requires the ARM target; it only requires X86 and OpenCSD.

Split the former etm-arch.test into ARM/etm-arch.test, containing the
two ARM-specific checks, and X86/etm-non-arm.test, containing the
existing X86 rejection check. The tested inputs and expected diagnostics
are preserved.


    [13 lines not shown]
DeltaFile
+3,000-0llvm/test/tools/llvm-profgen/X86/Inputs/cs-preinline-cost.perfscript
+0-3,000llvm/test/tools/llvm-profgen/Inputs/cs-preinline-cost.perfscript
+177-0llvm/test/tools/llvm-profgen/X86/recursion-compression-pseudoprobe.test
+0-177llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test
+0-176llvm/test/tools/llvm-profgen/Inputs/truncated-pseudoprobe.ll
+176-0llvm/test/tools/llvm-profgen/X86/Inputs/truncated-pseudoprobe.ll
+3,353-3,353256 files not shown
+8,180-8,179262 files

LLVM/project 26e34c6llvm/lib/IR Constants.cpp, llvm/test/Transforms/TailCallElim tre-minmax-intrinsic.ll accum_recursion.ll

[IR] Handle vector tys in ConstantExpr::getIntrinsicIdentity for smin/max. (#208367)

The code was using getIntegerBitWidth() when it should have been using
getScalarSizeInBits().  This resulted in an assert in debug builds, and
who-knows-what in opt builds.

Reproducer:

```
  define <4 x i32> @f(<4 x i32> %a, i32 %b) {
    %c = call <4 x i32> @f(<4 x i32> %a, i32 %b)
    %m = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %c, <4 x i32> %a)
    ret <4 x i32> %m
  }

  $ opt -passes=tailcallelim repro.ll
  Casting.h:572: Assertion `isa<To>(Val) && "cast<Ty>() argument of
  incompatible type!"' failed.
```

Bug found and fixed by Claude Mythos 5.
DeltaFile
+81-0llvm/test/Transforms/TailCallElim/tre-minmax-intrinsic.ll
+77-0llvm/test/Transforms/TailCallElim/accum_recursion.ll
+2-2llvm/lib/IR/Constants.cpp
+160-23 files

LLVM/project 11112edlibc/src/__support/CPP expected.h, libc/test/src/__support/CPP expected_test.cpp CMakeLists.txt

[libc] Make cpp::expected::operator bool explicit (#208681)

Without explicit, expected<T, E> implicitly converts to bool in all
sorts of unexpected contexts (e.g. `EXPECT_EQ(ErrorOr<int>(47), 1)`),
and also deviates from std::expected in C++23.

While in there, add basic unit tests for expected and unexpected (we
didn't have any tests for this utility yet), and update the file header.

Assisted by Gemini.
DeltaFile
+110-0libc/test/src/__support/CPP/expected_test.cpp
+11-0libc/test/src/__support/CPP/CMakeLists.txt
+7-2libc/src/__support/CPP/expected.h
+128-23 files

LLVM/project fd17f88llvm/lib/Target/RISCV RISCVISelLowering.cpp RISCVInstrInfoP.td

[RISCV][P-ext] Replace RISCVISD::PPAIRE_DB with RISCVISD::PPAIRE. NFC (#208980)

This replaces RISCVISD::PPAIRE_DB with the RISCVISD::PPAIRE added by
#208763.

This adds two CONCAT_VECTORS and two EXTRACT_SUBVECTORs during lowering
instead of waiting until isel to form the GPR pairs.
DeltaFile
+13-8llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+5-11llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+2-8llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+20-273 files

LLVM/project 9b9f44dllvm/include/llvm/ADT Eytzinger.h, llvm/unittests/ADT EytzingerTest.cpp CMakeLists.txt

[ADT] Introduce EytzingerTableSpan (#208885)

This patch introduces EytzingerTableSpan, a non-owning view of a buffer
formatted as a complete binary search tree in Eytzinger (breadth-first)
order.

RFC:
https://discourse.llvm.org/t/rfc-faster-sample-profile-loading/90957/7

Assisted-by: Antigravity
DeltaFile
+198-0llvm/unittests/ADT/EytzingerTest.cpp
+115-0llvm/include/llvm/ADT/Eytzinger.h
+1-0llvm/unittests/ADT/CMakeLists.txt
+314-03 files

LLVM/project b1c56fborc-rt/include/orc-rt-c Logging.h, orc-rt/lib/executor Logging_oslog.cpp

[orc-rt] Add os_log logging backend (Darwin only) (#209081)

Implement the os_log backend, selected with ORC_RT_LOG_BACKEND=os_log.
With this backend selected, the ORC_RT_LOG macros expand at the call
site to os_log_with_type. Each ORC runtime log level maps to an
os_log_type_t (error -> ERROR, warning -> DEFAULT, info -> INFO, debug
-> DEBUG). The compile-time ORC_RT_LOG_LEVEL floor still applies, but
runtime filtering is left to the system (e.g. `log config`), so the
printf backend's ORC_RT_LOG and ORC_RT_LOG_OUTPUT have no effect.

Records go to the "org.llvm.orc-rt" subsystem with the category as the
os_log category. (Per-category handles are created on first use and
cached).

Add regression tests under test/regression/logging/os_log:
no-printf-output.test checks that the backend produces no console
output, and an opt-in delivery test (llvm-lit --param
run-os-log-tests=1) scrapes `log show` to confirm records reach the
expected subsystem and category.
DeltaFile
+86-2orc-rt/include/orc-rt-c/Logging.h
+45-0orc-rt/lib/executor/Logging_oslog.cpp
+20-0orc-rt/test/regression/lit.cfg.py
+17-0orc-rt/test/regression/logging/os_log/delivery.test
+13-0orc-rt/test/tools/orc-rt-log-check.cpp
+6-0orc-rt/test/regression/logging/os_log/no-printf-output.test
+187-22 files not shown
+194-28 files

LLVM/project d8df9b5flang/lib/Semantics check-call.cpp, flang/test/Semantics call48.f90

[Flang] Fix for the spurious error for VOLATILE actual argument in implicit interface CALL (#192605)

Fixes #191343

Replaced the error with warning. Now it permits calling an external
procedure with implicit interface and passing a volatile argument. There
will be a warning that the procedure should have an explicit interface.

In addition to fixing the VOLATILE error, I updated the semantic check
for the ASYNCHRONOUS attribute. Both attributes were incorrectly
throwing a hard error when used as actual arguments in an implicit
interface call. According to the Fortran 2018 standard, an explicit
interface is only mandatory when the dummy argument has the VOLATILE or
ASYNCHRONOUS attribute. Since the standard doesn't restrict actual
arguments in this scenario, I downgraded both to emit a
-Wimplicit-interface-actual warning instead.
DeltaFile
+20-0flang/test/Semantics/call48.f90
+6-4flang/lib/Semantics/check-call.cpp
+26-42 files

LLVM/project d91a1e8.github/workflows libcxx-build-and-test.yaml

[libc++] Switch use llvm-premerge-libcxx-runner (#208928)

Signed-off-by: yronglin <yronglin777 at gmail.com>
Co-authored-by: Aiden Grossman <aidengrossman at google.com>
DeltaFile
+3-3.github/workflows/libcxx-build-and-test.yaml
+3-31 files

LLVM/project 3968f6fllvm/lib/Target/WebAssembly WebAssemblyCodeGenPassBuilder.cpp WebAssemblyReduceToAnyAllTrue.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+235-0llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+125-104llvm/lib/Target/WebAssembly/WebAssemblyReduceToAnyAllTrue.cpp
+214-0llvm/lib/Target/WebAssembly/WebAssemblyCoalesceFeaturesAndStripAtomics.cpp
+22-187llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+108-99llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
+108-17llvm/lib/Target/WebAssembly/WebAssembly.h
+812-40712 files not shown
+1,078-49418 files

LLVM/project ce4aa47llvm/lib/Target/WebAssembly WebAssemblyCodeGenPassBuilder.cpp WebAssemblyReduceToAnyAllTrue.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+235-0llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+125-104llvm/lib/Target/WebAssembly/WebAssemblyReduceToAnyAllTrue.cpp
+214-0llvm/lib/Target/WebAssembly/WebAssemblyCoalesceFeaturesAndStripAtomics.cpp
+20-185llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+98-15llvm/lib/Target/WebAssembly/WebAssembly.h
+68-38llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+760-34211 files not shown
+956-39117 files

LLVM/project e6673bdllvm/lib/Transforms/Vectorize SLPVectorizer.cpp CMakeLists.txt, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPUtils.cpp SLPUtils.h

[SLP][Modularization][NFC] Extract type and constant helpers into SLPUtils (1/3) (#206881)

As we discussed on RFC:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922

This patch introduces the SLPVectorizer/ subdirectory and adds
SLPUtils.{h,cpp} under namespace llvm::slpvectorizer, then moves the
type and constant query helpers into it:
  - isConstant
  - isVectorLikeInstWithConstOps
  - isSplat
  - allConstant
  - allSameBlock
  - allSameType
  - allSameOpcode
  - getNumElements
  - getPartNumElems
  - getNumElems
  - getInsertExtractIndex
  - getExtractIndex
DeltaFile
+186-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPUtils.cpp
+1-180llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+85-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPUtils.h
+1-0llvm/lib/Transforms/Vectorize/CMakeLists.txt
+273-1804 files

LLVM/project 171ba71bolt/lib/Rewrite DWARFRewriter.cpp, bolt/test/X86 dwarf5-debug-names-cross-cu.s dwarf4-cross-cu-ranges.test

[BOLT] fix DIE traversal incorrect loop termination condition. (#208450)

The DIE traversal loop in partitionCUs() used an incorrect termination
condition, causing it to read past the end of the CU. Fix the loop to
stop at NextCUOffset so traversal no longer runs beyond the unit's
boundary.

Fixed [#208440](https://github.com/llvm/llvm-project/issues/208440).
DeltaFile
+5-9bolt/lib/Rewrite/DWARFRewriter.cpp
+3-1bolt/test/X86/dwarf5-debug-names-cross-cu.s
+3-1bolt/test/X86/dwarf4-cross-cu-ranges.test
+11-113 files

LLVM/project 461f0b6lldb/include/lldb/Host JSONTransport.h

[LLDB] Fix use-after-free destroying a Binder from its OnClosed handler (#209019)

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 692d89dlldb/source/Host/freebsd Host.cpp

[LLDB][FreeBSD] Fill pgid and sid in ProcessInfo (#209009)

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 c7812f6llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 copyable-repeated-operand-partial-commutativity.ll

[SLP] Fix crash from repeated operand with mixed commutativity

A value used as both a commutable and non-commutable operand of the
same call got double-counted in dependency tracking, adding a
dependency scheduling never releases and tripping an assertion.

Fixes #209005

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/209067
DeltaFile
+28-0llvm/test/Transforms/SLPVectorizer/X86/copyable-repeated-operand-partial-commutativity.ll
+3-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+31-02 files

LLVM/project 7d24dfalld/docs ReleaseNotes.rst

ReleaseNotes: add lld/ELF notes (#209066)

Summarize `git log origin/release/22.x..main` entries, excluding
cherry-picked notes `git rev-list main..origin/release/22.x -- lld/ELF`,
following the style of my previous release notes.
DeltaFile
+81-1lld/docs/ReleaseNotes.rst
+81-11 files

LLVM/project c847ddflld/ELF Writer.cpp, lld/unittests/AsLibELF OutputStream.cpp CMakeLists.txt

[ELF] Write the output to lld::outs() when -o is - (#209064)

When the output file is "-", write the image to lld::outs() (the
stdoutOS
argument of lld::elf::link()) instead of committing the
FileOutputBuffer,
which writes to the process's stdout. This lets lld used as a library
capture
the output in a raw_ostream without an open syscall.

This reimplements the stale #72061 and adds a unittest.
DeltaFile
+35-0lld/unittests/AsLibELF/OutputStream.cpp
+8-1lld/ELF/Writer.cpp
+1-0lld/unittests/AsLibELF/CMakeLists.txt
+44-13 files

LLVM/project b6e77d6clang/unittests/ScalableStaticAnalysis/Analyses/OperatorNewDelete OperatorNewDeletePointersExtractorTest.cpp

[Clang][Test] Fix -Wctad-maybe-unsupported in OperatorNewDeletePointersExtractorTest.cpp (#209012)

Fix warning: `'std::set' may not intend to support class template
argument deduction [-Wctad-maybe-unsupported]`, which is error under
-Werror.
std::set{*PtrId} does implicitly deduce to std::set<EntityId>, but it
is not explicit or user-defined CATD guide. Opt-in warning
-Wctad-maybe-unsupported flags it as maybe unsafe and unintended. The
warning is enabled at
https://github.com/llvm/llvm-project/blob/9083925dadb4/llvm/cmake/modules/HandleLLVMOptions.cmake#L977
Relates to #206600.
DeltaFile
+6-6clang/unittests/ScalableStaticAnalysis/Analyses/OperatorNewDelete/OperatorNewDeletePointersExtractorTest.cpp
+6-61 files

LLVM/project 9083925lld/test/ELF retain-symbols-file.s retain-und.s

[ELF,test] Modernize --retain-symbols-file tests (#209062)

Switch to llvm-readelf, compact FileCheck directives, and
split-file-style naming. Prepares for a --retain-symbols-file behavior
change.
DeltaFile
+37-52lld/test/ELF/retain-symbols-file.s
+10-10lld/test/ELF/retain-und.s
+47-622 files

LLVM/project fe85b5bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 minbitwidth-signed-icmp-const.ll

[SLP] Fix miscompile from truncating signed icmp constant

getActiveBits() ignores sign, so a positive constant needing the
narrower type's top bit was truncated to a negative value. Use
getSignificantBits() for signed comparisons.

Fixes #209010

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/209061
DeltaFile
+7-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+2-1llvm/test/Transforms/SLPVectorizer/X86/minbitwidth-signed-icmp-const.ll
+9-32 files