LLVM/project 697fcd0llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG UnreachableEliminate.ll

[SimplifyCFG] Handle `llvm.assume` in `passingValueIsAlwaysUndefined` (#89929)

See the following example:
```
define i32 @test(i32 %cond) {
entry:
  switch i32 %cond, label %default [
    i32 0, label %case0
    i32 1, label %case1
    i32 2, label %case2
  ]

case0:
  br label %exit

case1:
  br label %exit

case2:

    [18 lines not shown]
DeltaFile
+226-0llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
+7-0llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+233-02 files

LLVM/project ee73651llvm/lib/ExecutionEngine/Orc MemoryMapper.cpp, llvm/lib/ExecutionEngine/Orc/TargetProcess ExecutorSharedMemoryMapperService.cpp

[z/OS] Implement shared memory handling for JIT (#89933)

Fix 'use of undeclared identifier' build errors for shm_ functions on
z/OS by implementing the functionality using shmget(), shmat(), and
shmdt(). Use the BLAKE3 hash to map the name of the shared memory to a
key.

---------

Co-authored-by: Kai Nacke <kai.peter.nacke at ibm.com>
DeltaFile
+32-0llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
+31-0llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
+63-02 files

LLVM/project deafb36flang/test/Lower/OpenMP if-clause.f90 use-device-ptr-to-use-device-addr.f90, flang/test/Lower/OpenMP/FIR if-clause.f90 target.f90

[flang][OpenMP] Add OpenMP versions to some tests (#89295)

Some constructs used in the tests are only allowed in certain OpenMP
spec versions. Add a flag with the minimum required OpenMP version
(other than the default version) to these tests that need it.
DeltaFile
+4-2flang/test/Lower/OpenMP/if-clause.f90
+4-2flang/test/Lower/OpenMP/FIR/if-clause.f90
+3-2flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90
+3-2flang/test/Lower/OpenMP/simd.f90
+2-1flang/test/Lower/OpenMP/FIR/target.f90
+2-1flang/test/Lower/OpenMP/target.f90
+18-101 files not shown
+20-117 files

LLVM/project 76ea5fellvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 concatbinop.ll vecreduce-add.ll

[AArch64] Combine concat(binop, binop) into binop(concat, concat) (#89911)

This generalizes the existing combine for concat(radd, radd) to any
binops. For much the same reason as the existing code, pushing the
concat up through the tree are hopefully quicker (or the same) as the
existing two half-vector operations, and can help combine away the
concat.
DeltaFile
+50-31llvm/test/CodeGen/AArch64/concatbinop.ll
+8-6llvm/test/CodeGen/AArch64/vecreduce-add.ll
+5-7llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+63-443 files

LLVM/project 03b1a0cclang/include/clang/Basic DiagnosticFrontendKinds.td, clang/lib/Frontend FrontendAction.cpp

[Clang] Diagnose apply AST consume actions on LLVM IR (#88602)

Fixes https://github.com/llvm/llvm-project/issues/88522

This PR introduce a new diagnostic to report apply AST consume actions
on LLVM IR.

---------

Signed-off-by: yronglin <yronglin777 at gmail.com>
DeltaFile
+29-0clang/test/Frontend/ast-dump-on-llvm.ll
+5-2clang/lib/Frontend/FrontendAction.cpp
+3-0clang/include/clang/Basic/DiagnosticFrontendKinds.td
+37-23 files

LLVM/project 2c5d7a8clang/lib/Format Format.cpp

[clang-format] Remove YAML hack to emit a BasedOnStyle comment (#89228)

When serializing a formatting style to YAML, we were emitting a comment
`# BasedOnStyle: <style>` if the serialized formatting style matches one
of the known styles. This is useful, but mis-uses the YAML API.

An upcoming change to fix keys with special characters by quoting them
breaks this,
and will emit a non-comment **key** `'# BasedOnStyle': <style>` instead.
(https://github.com/llvm/llvm-project/pull/88763)

Thus, remove this hack. There doesn't seem to be a specific use for it,
and it is not tested.

If we want the comment back, we should add comment support to the YAML writer,
and use that instead.
DeltaFile
+0-1clang/lib/Format/Format.cpp
+0-11 files

LLVM/project 2125080llvm/lib/Target/RISCV RISCVInstrInfo.cpp

[RISCV][NFC] Undef CASE_RVV_OPCODE* macros after using
DeltaFile
+10-0llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+10-01 files

LLVM/project d5f2753llvm/test/Analysis/LoopAccessAnalysis different-strides-safe-dep-due-to-backedge-taken-count.ll

[LAA] Tests with different strides where BTC can rule out dependence.

Tests to add support for different strides with isSafeDependenceDistance
as follow-up to https://github.com/llvm/llvm-project/pull/88039.
DeltaFile
+156-0llvm/test/Analysis/LoopAccessAnalysis/different-strides-safe-dep-due-to-backedge-taken-count.ll
+156-01 files

LLVM/project 87ec4abclang/lib/CodeGen CGDebugInfo.cpp, clang/test/CodeGenCXX dependent-template-alias.cpp

[Clang] Fall back to DW_TAG_typedef for instantiation dependent template aliases (#90032)

Workaround for issue #89774 until it can be properly fixed.

When `-gtemplate-alias` is specified Clang emits a DW_TAG_template_alias
for template aliases. This patch avoids an assertion failure by falling
back to the `-gno-template-alias` (default) behaviour, emitting a
DW_TAG_typedef, if the alias is instantiation dependent.
DeltaFile
+21-0clang/test/CodeGenCXX/dependent-template-alias.cpp
+20-1clang/lib/CodeGen/CGDebugInfo.cpp
+41-12 files

LLVM/project d7a7273clang/lib/AST ODRHash.cpp, clang/test/Modules recursive-instantiations.cppm

Avoid computing ODR Hash duplicatly
DeltaFile
+40-0clang/test/Modules/recursive-instantiations.cppm
+0-10clang/lib/AST/ODRHash.cpp
+40-102 files

LLVM/project f4edc5bclang/include/clang/AST DeclTemplate.h, clang/lib/AST DeclTemplate.cpp

[Serialization] Code cleanups and polish 83233
DeltaFile
+40-48clang/lib/AST/DeclTemplate.cpp
+3-73clang/lib/Serialization/ASTReaderDecl.cpp
+4-48clang/lib/Serialization/ASTWriterDecl.cpp
+9-31clang/include/clang/AST/DeclTemplate.h
+4-22clang/lib/Serialization/ASTWriter.cpp
+12-5clang/lib/Serialization/ASTReader.cpp
+72-2278 files not shown
+87-23714 files

LLVM/project 80c9ab1clang/include/clang/Serialization ASTReader.h, clang/lib/Serialization ASTWriter.cpp ASTReader.cpp

[Serialization] Introduce OnDiskHashTable for specializations

Following up for https://github.com/llvm/llvm-project/pull/83108

This follows the suggestion literally from
https://github.com/llvm/llvm-project/pull/76774#issuecomment-1951172457

which introduces OnDiskHashTable for specializations based on
D41416.

Note that I didn't polish this patch to reduce the diff from D41416
to it easier to review. I'll make the polishing patch later. So that we
can focus what we're doing in this patch and focus on the style in the
next patch.
DeltaFile
+260-0clang/unittests/Serialization/LoadSpecLazilyTest.cpp
+173-1clang/lib/Serialization/ASTWriter.cpp
+143-2clang/lib/Serialization/ASTReader.cpp
+124-0clang/lib/Serialization/ASTReaderInternals.h
+31-3clang/include/clang/Serialization/ASTReader.h
+25-7clang/lib/Serialization/ASTWriterDecl.cpp
+756-139 files not shown
+856-1315 files

LLVM/project 81442f8flang/include/flang/Optimizer/Transforms Passes.h Passes.td, flang/include/flang/Tools CLOptions.inc

[flang][NFC] Use tablegen to create SimplifyIntrinsics constructor (#89963)

This pass runs on ModuleOp, internally walking all func::CallOps so it
shouldn't need anything special to work on other top level operations.
DeltaFile
+3-3flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
+1-1flang/include/flang/Tools/CLOptions.inc
+0-1flang/include/flang/Optimizer/Transforms/Passes.h
+0-1flang/include/flang/Optimizer/Transforms/Passes.td
+4-64 files

LLVM/project 92f4f0bflang/include/flang/Optimizer/Transforms Passes.td Passes.h, flang/include/flang/Tools CLOptions.inc

[flang][NFC] Use tablegen to create simplifyRegionLite constructor (#89957)

This is a ModuleOp pass anyway so it doesn't need to be run on
particular top level operations.
DeltaFile
+3-3flang/include/flang/Tools/CLOptions.inc
+0-4flang/lib/Optimizer/Transforms/SimplifyRegionLite.cpp
+0-1flang/include/flang/Optimizer/Transforms/Passes.td
+0-1flang/include/flang/Optimizer/Transforms/Passes.h
+3-94 files

LLVM/project 7bc0177flang/include/flang/Tools CLOptions.inc, flang/lib/Optimizer/Transforms CharacterConversion.cpp

[flang] run character conversion pass on all top level ops (#89910)

See RFC:

https://discourse.llvm.org/t/rfc-add-an-interface-for-top-level-container-operations

Some of the changes are from moving declaration and definition of the
constructor function into tablegen (as requested in code review when
altering another pass).
DeltaFile
+3-4flang/lib/Optimizer/Transforms/CharacterConversion.cpp
+5-0flang/test/Fir/basic-program.fir
+5-0flang/test/Driver/bbc-mlir-pass-pipeline.f90
+5-0flang/test/Driver/mlir-debug-pass-pipeline.f90
+5-0flang/test/Driver/mlir-pass-pipeline.f90
+1-1flang/include/flang/Tools/CLOptions.inc
+24-52 files not shown
+24-78 files

LLVM/project 672fde1clang/include/clang/AST DeclTemplate.h, clang/lib/AST DeclTemplate.cpp

fmt
DeltaFile
+15-14clang/lib/Serialization/ASTWriterDecl.cpp
+12-14clang/lib/AST/DeclTemplate.cpp
+11-10clang/lib/Serialization/ASTReaderDecl.cpp
+3-3clang/lib/Serialization/ASTWriter.cpp
+2-2clang/include/clang/AST/DeclTemplate.h
+43-435 files

LLVM/project 0d257f1clang/test/Modules cxx-templates.cpp odr_hash.cpp

Fix test mismatch failure
DeltaFile
+5-4clang/test/Modules/cxx-templates.cpp
+2-2clang/test/Modules/odr_hash.cpp
+7-62 files

LLVM/project be1c83fclang/include/clang/AST DeclTemplate.h, clang/lib/AST DeclTemplate.cpp

D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one.
DeltaFile
+77-23clang/lib/AST/DeclTemplate.cpp
+62-14clang/lib/Serialization/ASTWriterDecl.cpp
+27-19clang/lib/Serialization/ASTReaderDecl.cpp
+32-4clang/include/clang/AST/DeclTemplate.h
+16-7clang/lib/Serialization/ASTReader.cpp
+19-2clang/lib/Serialization/ASTWriter.cpp
+233-691 files not shown
+248-697 files

LLVM/project fe47e8fclang/lib/Frontend ASTUnit.cpp

[NFC] [ASTUnit] [Serialization] Transalte local decl ID to global decl ID before consuming

Discovered from
https://github.com/llvm/llvm-project/commit/d86cc73bbfd9a22d9a0d498d72c9b2ee235128e9.

There is a potential issue of using DeclID in ASTUnit. ASTUnit may
record the declaration ID from ASTWriter. And after loading the
preamble, the ASTUnit may consume the recorded declaration ID directly
in ExternalASTSource. This is not good. According to the design, all
local declaration ID consumed in ASTReader need to be translated by
`ASTReader::getGlobaldeclID()`.

This will be problematic if we changed the encodings of declaration IDs or if we
make preamble to work more complexly.
DeltaFile
+3-4clang/lib/Frontend/ASTUnit.cpp
+3-41 files

LLVM/project 51f6570lldb/docs lldb-platform-packets.txt index.rst, lldb/docs/resources lldbplatformpackets.md

[lldb][Docs] Convert platform packets doc to Markdown (#89913)

As before, script did most of the work, hand edits after that.

There's a lot more we can do dedupe this and the packets doc, this will
come in a follow up PR.
DeltaFile
+484-0lldb/docs/resources/lldbplatformpackets.md
+0-451lldb/docs/lldb-platform-packets.txt
+1-0lldb/docs/index.rst
+485-4513 files

LLVM/project 5e767bdclang/docs ReleaseNotes.rst, clang/lib/Sema TreeTransform.h

Push immediate function context while transforming lambdas in templates. (#89702)

The following program is [accepted](https://godbolt.org/z/oEc34Trh4) by
Clang, EDG, and MSVC, but rejected by Clang:
```cpp
#include <vector>

consteval auto fn() { return std::vector {1,2,3}; }

template <typename T = int>
void fn2() {
    (void)[]() consteval {
      for (auto e : fn()) {}
    };
}

void caller() {
    fn2();
}

    [11 lines not shown]
DeltaFile
+20-0clang/test/SemaCXX/cxx2a-consteval.cpp
+2-0clang/docs/ReleaseNotes.rst
+2-0clang/lib/Sema/TreeTransform.h
+24-03 files

LLVM/project 0894946llvm/test/Instrumentation/InstrProfiling/Coro coro-split-musttail7.ll coro-split-musttail6.ll

[coro][pgo] Remove redundant coroutine test files (#89620)

Each of these is a copy of a test under Transforms/Coroutines/

The PGO functionality is already covered by multiple runlines (pgo and
no pgo) in the original files, so the copies add no new coverage, only
maintenance problems.
DeltaFile
+0-115llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail7.ll
+0-112llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail6.ll
+0-97llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail1.ll
+0-91llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail3.ll
+0-85llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail12.ll
+0-76llvm/test/Instrumentation/InstrProfiling/Coro/coro-split-musttail13.ll
+0-5766 files not shown
+0-94612 files

LLVM/project ed6e6afllvm/test/Transforms/Coroutines coro-split-musttail11.ll coro-split-musttail10.ll

[coro] Merge two almost identical tests (#89928)

llvm/test/Transforms/Coroutines/coro-split-musttail10.ll and
coro-split-musttail11.ll were the same except for the triple.

Also add a requires clause.
DeltaFile
+0-55llvm/test/Transforms/Coroutines/coro-split-musttail11.ll
+7-4llvm/test/Transforms/Coroutines/coro-split-musttail10.ll
+7-592 files

LLVM/project b9208ceclang/lib/Analysis/FlowSensitive DataflowEnvironment.cpp, clang/unittests/Analysis/FlowSensitive TransferTest.cpp

[clang][dataflow] Crash fix for `widenDistinctValues()`. (#89895)

We used to crash if the previous iteration contained a `BoolValue` and
the
current iteration contained an `IntegerValue`. The accompanying test
sets up
this situation -- see comments there for details.

While I'm here, clean up the tests for integral casts to use the test
helpers we
have available now. I was looking at these tests to understand how we
handle
integral casts, and the test helpers make the tests easier to read.
DeltaFile
+32-33clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+9-4clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+41-372 files

LLVM/project 9b0651fclang/lib/Analysis/FlowSensitive DataflowEnvironment.cpp, clang/unittests/Analysis/FlowSensitive TransferTest.cpp

[clang][dataflow] Don't propagate result objects in nested declarations. (#89903)

Trying to do so can cause crashes -- see newly added test and the
comments in
the fix.
DeltaFile
+22-0clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+12-0clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+34-02 files

LLVM/project 8bfdbb9llvm/lib/Transforms/InstCombine InstCombineShifts.cpp

[InstCombine] Remove redundant shift folds (NFCI) (#90016)

These are already handled by canEvaluateShifted/getShiftedValue (one-use
only), and also in reassociateShiftAmtsOfTwoSameDirectionShifts (also
multi-use), so let's at least get rid of the *third* implementation...
DeltaFile
+0-16llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+0-161 files

LLVM/project 565bdb5lldb/include/lldb/API SBType.h, lldb/include/lldb/Symbol TypeSystem.h

[lldb] Add SB API to access static constexpr member values (#89730)

The main change is the addition of a new SBTypeStaticField class,
representing a static member of a class. It can be retrieved created
through SBType::GetStaticFieldWithName. It contains several methods
(GetName, GetMangledName, etc.) whose meaning is hopefully obvious. The
most interesting method is
        lldb::SBValue GetConstantValue(lldb::SBTarget)
which returns a the value of the field -- if it is a compile time
constant. The reason for that is that only constants have their values
represented in the clang AST.

For non-constants, we need to go back to the module containing that
constant, and ask retrieve the associated ValueObjectVariable. That's
easy enough if the we are still in the type system of the module
(because then the type system will contain the pointer to the module
symbol file), but it's hard when the type has been copied into another
AST (e.g. during expression evaluation). To do that we would need to
walk the ast import chain backwards to find the source TypeSystem, and I

    [10 lines not shown]
DeltaFile
+88-0lldb/source/API/SBType.cpp
+52-0lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+33-0lldb/test/API/python_api/type/TestTypeList.py
+32-0lldb/include/lldb/API/SBType.h
+9-0lldb/include/lldb/Symbol/TypeSystem.h
+9-0lldb/source/Symbol/CompilerDecl.cpp
+223-07 files not shown
+251-013 files

LLVM/project d86cc73clang/include/clang/AST DeclID.h DeclCXX.h, clang/lib/AST DeclCXX.cpp

[NFC] [Serialization] Avoid using DeclID directly as much as possible

This patch tries to remove all the direct use of DeclID except the real
low level reading and writing. All the use of DeclID is converted to
the use of LocalDeclID or GlobalDeclID. This is helpful to increase the
readability and type safety.
DeltaFile
+99-112clang/lib/Serialization/ASTReaderDecl.cpp
+95-45clang/include/clang/AST/DeclID.h
+40-37clang/lib/Serialization/ASTWriter.cpp
+38-29clang/lib/AST/DeclCXX.cpp
+38-28lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+31-28clang/include/clang/AST/DeclCXX.h
+341-27932 files not shown
+583-50938 files

LLVM/project 72b5814clang/include/clang/AST DeclID.h DeclCXX.h, clang/lib/AST DeclCXX.cpp

Revert "[NFC] [Serialization] Avoid using DeclID directly as much as possible"

This reverts commit 42070a5c092ed420bf92ebf38229c594885e94c7.

I forgot to touch lldb.
DeltaFile
+112-99clang/lib/Serialization/ASTReaderDecl.cpp
+45-95clang/include/clang/AST/DeclID.h
+37-40clang/lib/Serialization/ASTWriter.cpp
+29-38clang/lib/AST/DeclCXX.cpp
+28-31clang/include/clang/AST/DeclCXX.h
+25-25clang/include/clang/AST/DeclTemplate.h
+276-32829 files not shown
+479-54335 files

LLVM/project 011a653llvm/lib/Target/RISCV RISCVInsertVSETVLI.cpp, llvm/test/CodeGen/RISCV/rvv vsetvli-insert.mir vsetvli-insert-crossbb.mir

[RISCV] Split out VSETVLIInfo AVL states to be more explicit (#89964)

We currently use AVLIsReg to represent VLMAX as well as a dummy value
for
whenever the VL is ignored by vmv.x.s. This splits them out into
separate
states so that AVLIsReg is always a virtual register and should help
with
tracking the definition inside VSETVLIInfo directly in #89180.

This is almost an NFC but it sets the kill flag for x0 in more places.
DeltaFile
+82-59llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+10-10llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.mir
+6-6llvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.mir
+98-753 files