LLVM/project 02f7369libcxx/include __verbose_trap

[libc++] Remove AppleClang woraround for __builtin_verbose_trap (#199171)

We've dropped support for AppleClang versions with a different
`__builtin_verbose_trap`, so we can remove the workaround.
DeltaFile
+1-8libcxx/include/__verbose_trap
+1-81 files

LLVM/project fd45c0bllvm/utils/lit/tests/unit Util.py

Revert "[AIX] Remove unsupported AIX native echo option -n (llvm#199079)" (#199277)

This reverts commit 593eb2066293c8636786c98cb696c533da9b97ca.
The patch is being reverted as the code changes and the commit message
and description do not match and point to a previous implementation

Co-authored-by: himadhith <himadhith.v at ibm.com>
DeltaFile
+2-2llvm/utils/lit/tests/unit/Util.py
+2-21 files

LLVM/project 38146ceclang/docs LanguageExtensions.rst, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[PowerPC][AIX] Add -mloadtime-comment-vars support to preserve variables
in the final object file.
DeltaFile
+168-74llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+77-0clang/lib/CodeGen/CodeGenModule.cpp
+67-0clang/docs/LanguageExtensions.rst
+37-0clang/test/CodeGen/loadtime-comment-vars.c
+34-0llvm/test/Transforms/LowerCommentString/loadtime-comment-vars.ll
+8-0clang/lib/CodeGen/CodeGenModule.h
+391-743 files not shown
+406-749 files

LLVM/project 268182aclang/docs LanguageExtensions.rst, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[PowerPC][AIX] Add -mloadtime-comment-vars support to preserve variables
in the final object file.
DeltaFile
+155-74llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+77-0clang/lib/CodeGen/CodeGenModule.cpp
+67-0clang/docs/LanguageExtensions.rst
+37-0clang/test/CodeGen/loadtime-comment-vars.c
+34-0llvm/test/Transforms/LowerCommentString/loadtime-comment-vars.ll
+8-0clang/lib/CodeGen/CodeGenModule.h
+378-743 files not shown
+393-749 files

LLVM/project a31b969clang/docs LanguageExtensions.rst, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[PowerPC][AIX] Add -mloadtime-comment-vars support to preserve variables
in the final object file.
DeltaFile
+154-74llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+77-0clang/lib/CodeGen/CodeGenModule.cpp
+67-0clang/docs/LanguageExtensions.rst
+37-0clang/test/CodeGen/loadtime-comment-vars.c
+34-0llvm/test/Transforms/LowerCommentString/loadtime-comment-vars.ll
+8-0clang/lib/CodeGen/CodeGenModule.h
+377-743 files not shown
+392-749 files

LLVM/project 22d9a5dllvm/utils/lit/lit TestRunner.py cl_arguments.py, llvm/utils/lit/tests fn-selection.py

Add --fn flag to llvm-lit to inject select-function pass into opt pipelines

Translates --fn=fn0,fn1 into -passes='select-function<fn=fn0;fn=fn1>,...'
by rewriting -passes= arguments in RUN lines after substitution.
Handles both single and double quoted pass pipelines.
DeltaFile
+23-0llvm/utils/lit/tests/fn-selection.py
+19-0llvm/utils/lit/lit/TestRunner.py
+17-0llvm/utils/lit/lit/cl_arguments.py
+7-0llvm/utils/lit/tests/Inputs/fn-selection/lit.cfg
+2-0llvm/utils/lit/lit/LitConfig.py
+2-0llvm/utils/lit/tests/Inputs/fn-selection/sample.ll
+70-01 files not shown
+71-07 files

LLVM/project 9e0c7f4llvm/include/llvm/Transforms/IPO SelectFunction.h, llvm/lib/Passes PassBuilder.cpp

Add select-function pass to keep only specified functions and their dependencies

Chains InternalizePass, GlobalDCEPass, and StripDeadPrototypesPass to
remove everything not transitively reachable from the selected functions.
Supports multiple roots via select-function<fn=foo;fn=bar>.
DeltaFile
+57-0llvm/test/Transforms/SelectFunction/multi-select.ll
+52-0llvm/include/llvm/Transforms/IPO/SelectFunction.h
+48-0llvm/lib/Transforms/IPO/SelectFunction.cpp
+36-0llvm/test/Transforms/SelectFunction/basic.ll
+35-0llvm/test/Transforms/SelectFunction/diamond.ll
+23-0llvm/lib/Passes/PassBuilder.cpp
+251-04 files not shown
+289-010 files

LLVM/project 5727dadoffload/test lit.cfg

[offload] Fix --libomptarget-nvptx-bc-path in tests

PR #198622, which landed as 3383f0d6fe01, causes 272 `libomptarget ::
nvptx64-nvidia-cuda` test fails on my system with:

```
clang: error: bitcode library '/home/jdenny/llvm/build/\./lib/x86_64-unknown-linux-gnu/nvptx64-nvidia-cuda' does not exist
```

This patch fixes that.
DeltaFile
+1-1offload/test/lit.cfg
+1-11 files

LLVM/project f95ccballvm/lib/Target/RISCV RISCVRegisterInfo.cpp, llvm/test/CodeGen/RISCV fixed-x27-crash.ll

[RISCV] Reserve all sub-registers of user reserved GPRs (#199302)

When a GPR is reserved by the user (e.g., via  `-mattr=+reserve-x27`)
or marked as constant, only the top-level register was being marked
reserved in `RISCVRegisterInfo::getReservedRegs`. Its sub-registers
(`X27_W` and `X27_H`) remained unreserved.

This broke `LiveIntervals` when register pressure tracking was enabled
by #115445. Because the sub-registers were not reserved, the register
unit was considered non-reserved, causing `LiveIntervals` to track its
liveness and crash in the Machine Verifier due to the reserved
register missing from basic block live-in lists.

Instead, we should ensure that reserving a register also reserves all
of its sub-registers, so that the register unit is correctly
identified as reserved and ignored by `LiveIntervals`.

Fixes #176227
DeltaFile
+16-0llvm/test/CodeGen/RISCV/fixed-x27-crash.ll
+8-4llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
+24-42 files

LLVM/project 8b56d41llvm/lib/Transforms/Vectorize LoopVectorize.cpp

[VPlan] Create casts before ComputeReductionResult (NFC). (#199372)

This ensures ComputeReductionResult is created with operands that have
their correct types set at construction.
DeltaFile
+30-34llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+30-341 files

LLVM/project 5ccea57llvm/utils/gn/secondary/clang/lib/CodeGen BUILD.gn, llvm/utils/gn/secondary/lldb/source/Target BUILD.gn

[gn build] Port commits (#199375)

170d37d861b0
1b0e603087b6
9997b11c6469
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn
+1-0llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn
+0-1llvm/utils/gn/secondary/lldb/source/Target/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/lib/CodeGen/BUILD.gn
+3-14 files

LLVM/project 7bf2d97clang/docs LanguageExtensions.rst, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[PowerPC][AIX] Add -mloadtime-comment-vars support to preserve variables
in the final object file.
DeltaFile
+154-74llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+77-0clang/lib/CodeGen/CodeGenModule.cpp
+67-0clang/docs/LanguageExtensions.rst
+37-0clang/test/CodeGen/loadtime-comment-vars.c
+34-0llvm/test/Transforms/LowerCommentString/loadtime-comment-vars.ll
+8-0clang/lib/CodeGen/CodeGenModule.h
+377-743 files not shown
+392-749 files

LLVM/project 5c6af83llvm/lib/Transforms/Vectorize LoopVectorizationLegality.cpp, llvm/test/Transforms/LoopVectorize optsize.ll

[LV] Don't add stride SCEV predicates when runtime checks are disabled. (#199370)

Don't pass symbolic strides to getPtrStride if SCEV runtime checks are
not allowed (e.g. because optimizing for size). This prevents
getPtrStride from adding additional SCEV checks for symbolic strides.
DeltaFile
+30-20llvm/test/Transforms/LoopVectorize/optsize.ll
+5-3llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+35-232 files

LLVM/project 0344e9fllvm/lib/Transforms/Vectorize LoopVectorize.cpp VPlan.h

[VPlan] Thread types through VPHeaderPHIRecipe and VPDerivedIVRecipe (NFC) (#195894)

Update VPHeaderPHIRecipe and VPDerivedIVRecipe to set the scalar types
for their defined values.

This requires updating addReductionResultComputation to construct the
new chain for AnyOf reductions up-front.

Depends on https://github.com/llvm/llvm-project/pull/195891

PR: https://github.com/llvm/llvm-project/pull/195894
DeltaFile
+37-20llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+21-14llvm/lib/Transforms/Vectorize/VPlan.h
+1-12llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+11-0llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+2-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+72-485 files

LLVM/project a992929llvm/lib/Transforms/Utils LowerCommentStringPass.cpp

Apply changes from code browser

Apply changes from code browser
DeltaFile
+53-24llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+53-241 files

LLVM/project aaf3e32clang/include/clang/Options Options.td, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[PowerPC][AIX] Add -mloadtime-comment-vars support
DeltaFile
+88-54llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+78-0clang/lib/CodeGen/CodeGenModule.cpp
+28-0clang/test/CodeGen/loadtime-comment-vars.c
+26-0llvm/test/Transforms/LowerCommentString/loadtime-comment-vars.ll
+8-0clang/lib/CodeGen/CodeGenModule.h
+7-0clang/include/clang/Options/Options.td
+235-542 files not shown
+243-548 files

LLVM/project 47e6290llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine fmod.ll

[SimplifyLibCalls] Don't set nnan on synthesized frem in optimizeFMod (#199284)

LibCallSimplifier can fold a libcall to fmod to an frem instruction if
the fmod call doesn't set errno.

fmod(x, y) sets errno if x == +/-Inf or y == 0.  The old code assumed
that this was also a sufficient condition to prove that the result is
not NaN, and so unconditionally set the nnan fmf on the new frem
instruction.  That's not sound; e.g. fmod(x, NaN) == frem(x, NaN) ==
NaN.

We don't actually have to worry about propagating the `nnan` flag;
B.CreateFRemFMF does it for us automagically.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
DeltaFile
+19-5llvm/test/Transforms/InstCombine/fmod.ll
+7-12llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+26-172 files

LLVM/project 6d3bc00llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine fdim.ll

[SimplifyLibCalls] Fix optimizeFdim for Inf-Inf cases (#199306)

fdim(x,y) is defined as

    NaN if x or y is NaN, otherwise
    (x > y) ? x - y : +0

optimizeFdim computed fdim(x,y) as max(x-y, +0).  This is not correct
when x == y == +/-Inf; the result should be 0, but this optimization
returns NaN.

I was surprised by this bug because there's even a testcase checking the
incorrect behavior.  But returning 0 matches the description in C99 and
POSIX, where, just to be extra clear, the spelling of the piecewise
function is

    NaN if either input is NaN
    x - y if x > y
    +0    if x <= y

    [4 lines not shown]
DeltaFile
+9-1llvm/test/Transforms/InstCombine/fdim.ll
+4-4llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+13-52 files

LLVM/project 9d533e9clang/tools/libclang CIndex.cpp

[clang] Fix crash in getCursorRawComments. (#199328)

Fix a regression introduced in PR #198452 where querying raw comments on
invalid cursors caused a segmentation fault due to unconditional
ASTContext lookup. Adding an early exit for unsupported cursor kinds at
the top of getCursorRawComment safely avoids resolving the context on
invalid cursors with null translation units.
DeltaFile
+2-0clang/tools/libclang/CIndex.cpp
+2-01 files

LLVM/project 37a2205llvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize/X86/CostModel masked-interleaved-store-i16.ll

[LV] Determine NumPredStores before computing widening costs. (#199341)

Determine NumPredStores before computing widening costs, so we
consistently apply large predicated store cost to all stores, matching
the VPlan cost model. In practice that should not impact vectorization
decisions, as the huge cost for any predicated store other than the
first already effectively disables vectorization.
DeltaFile
+10-7llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+4-4llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-interleaved-store-i16.ll
+14-112 files

LLVM/project 494c9d9clang/docs LanguageExtensions.rst, llvm/lib/Analysis ModuleSummaryAnalysis.cpp

[Analysis][AIX] Add !implicit.ref globals as ThinLTO summary ref edges to support pragma comment(copyright) LTO interaction

Teach ModuleSummaryAnalysis to include globals referenced via
!implicit.ref metadata as explicit reference edges in the ThinLTO
module summary via a new helper findImplicitRefEdges.
DeltaFile
+89-0llvm/test/LTO/PowerPC/pragma-comment-copyright-thinlto.ll
+52-34llvm/test/LTO/PowerPC/pragma-comment-copyright-lto.ll
+39-0llvm/test/Analysis/ModuleSummaryAnalysis/implicit-ref-edges.ll
+32-0clang/docs/LanguageExtensions.rst
+24-0llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+236-345 files

LLVM/project c089860llvm/test/LTO/PowerPC pragma-comment-copyright-lto.ll

[LTO] [Test] Add full lto test llvm/test/LTO/PowerPC/pragma-comment-copyright-lto.ll.
DeltaFile
+67-0llvm/test/LTO/PowerPC/pragma-comment-copyright-lto.ll
+67-01 files

LLVM/project 953c539clang/lib/CodeGen CodeGenModule.h

[NFC] Make ProcessPragmaCommentCopyright() private and move EmitLoadTimeComment() to the end of the class.
DeltaFile
+7-7clang/lib/CodeGen/CodeGenModule.h
+7-71 files

LLVM/project a5f9a03clang/docs LanguageExtensions.rst, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

Apply suggestions from code review

Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
DeltaFile
+0-11clang/lib/CodeGen/CodeGenModule.cpp
+3-6clang/lib/CodeGen/CodeGenModule.h
+2-3clang/lib/Parse/ParsePragma.cpp
+2-2clang/docs/LanguageExtensions.rst
+2-2clang/test/Preprocessor/pragma-comment.c
+1-1llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+10-256 files

LLVM/project 0cfab95clang/lib/CodeGen CodeGenModule.cpp, clang/lib/Parse ParsePragma.cpp

[PowerPC][AIX] Support #pragma comment copyright for AIX

- Emit !aix.copyright.comment from Clang for the pragma.
- Lower it in LLVM to a TU-local string + llvm.used + !implicit.ref.
- Add module-import and backend relocation tests.
DeltaFile
+150-0llvm/lib/Transforms/Utils/LowerCommentStringPass.cpp
+92-0clang/test/Preprocessor/pragma-comment.c
+42-11clang/lib/Parse/ParsePragma.cpp
+52-0clang/lib/CodeGen/CodeGenModule.cpp
+41-0llvm/test/Transforms/LowerCommentString/lower-comment-string.ll
+30-0clang/test/CodeGen/PowerPC/pragma-comment-copyright-modules.cpp
+407-1122 files not shown
+531-1428 files

LLVM/project 4f82841libcxx/test/libcxx/containers/views/mdspan/mdspan assert.at.pass.cpp, libcxx/test/std/containers/views/mdspan/mdspan at.pass.cpp

[libc++][test] Merge test files for `mdspan::at` (#199330)

`libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.at.pass.cpp`
caused build bot failures for
- sanitizer-aarch64-linux-bootstrap-asan
- sanitizer-aarch64-linux-bootstrap-hwasan
- sanitizer-aarch64-linux-bootstrap-msan

It's not yet clear why current mechanisms don't work for these builds.
`TEST_HAS_NO_EXCEPTIONS` should have been working.

Also remove one unnecessary `static` and use `std::string_view(e.what())
== "mdspan"`.
DeltaFile
+0-112libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.at.pass.cpp
+73-1libcxx/test/std/containers/views/mdspan/mdspan/at.pass.cpp
+73-1132 files

LLVM/project 12e366allvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/test/CodeGen/X86 known-never-zero.ll

[DAG] UDIV/SDIV exact nodes support DemandedElts + add test (#198715)

Resolves #183047

This patch updates isKnownNeverZero to handle DemandedElts for UDIV and SDIV exact nodes.
DeltaFile
+6-12llvm/test/CodeGen/X86/known-never-zero.ll
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+7-132 files

LLVM/project 017f352llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-fshr-rot-128.ll vector-fshr-rot-256.ll

[X86] Lower vector 8-bit rotr(x, 1) to pavgb pattern (#198980)

Fixes #198060
DeltaFile
+14-17llvm/test/CodeGen/X86/vector-fshr-rot-128.ll
+14-16llvm/test/CodeGen/X86/vector-fshr-rot-256.ll
+10-0llvm/lib/Target/X86/X86ISelLowering.cpp
+38-333 files

LLVM/project 3106698clang-tools-extra/clang-doc BitcodeWriter.cpp

[clang-doc][nfc] Avoid combining constexpr with std::initializer_list as this seems to give MSVC trouble. (#199311)

Some Windows bots using MSVC 2019 and 2022 get assertion errors in the
clang-doc lit tests (see
[here](https://github.com/llvm/llvm-project/pull/198066). This seems to
be due to MSVC having trouble with a correctly initializing structures
using std::initializer_list when embedded in a struct declared with
constexpr.

This workaround changes constexpr to const in a struct definition to
avoid this issue.
DeltaFile
+1-1clang-tools-extra/clang-doc/BitcodeWriter.cpp
+1-11 files

LLVM/project 5e8be92llvm/lib/Target/X86 X86ISelLowering.cpp

[X86] combineVectorInsert - use generic zext/shift/or pattern for constant concatenation (#199344)

Generalised the code added in #198273 to make it easier to support other
combos in future patches.

Hopefully we can get load combining to work here soon.
DeltaFile
+8-5llvm/lib/Target/X86/X86ISelLowering.cpp
+8-51 files