LLVM/project c516344llvm/include/llvm/IR PassManager.h, llvm/test/Other lpm-require-analysis-optnone.ll

[PM] Make InvalidateAllAnalysesPass Optional (#196956)

Similar reasoning to 221a24e94f7b03ea881df34cc8867c58ac8fdb52. Making
this required means we end up with assertion failures in the LPM around
LCSSA.

This is a bit unfortunate given it would be nice to ensure we can
trivially invalidate analyses on optnone functions, but this matches the
old behavior and prevents and assertion failure for now.
DeltaFile
+1-1llvm/include/llvm/IR/PassManager.h
+1-0llvm/test/Other/lpm-require-analysis-optnone.ll
+2-12 files

LLVM/project bd0aad5clang/test/CXX/drs cwg9xx.cpp, clang/www cxx_dr_status.html

[clang][NFC] Mark CWG988 as implemented and add a test (#196889)

[CWG988](https://wg21.link/cwg988) specifies that reference collapsing
is performed when trying to form a reference to a `decltype`. Clang
implements this since 2.7: https://godbolt.org/z/vYzKbv8x7 (and I
checked a few versions after that to make sure there were no
regressions).
DeltaFile
+11-0clang/test/CXX/drs/cwg9xx.cpp
+1-1clang/www/cxx_dr_status.html
+12-12 files

LLVM/project cc4922bflang/lib/Frontend CompilerInvocation.cpp, flang/lib/Lower Bridge.cpp Allocatable.cpp

[flang] Remove legacy (non-HLFIR) lowering and related options (#196205)

Drop the user-facing options that selected the legacy non-HLFIR lowering
path, the always-true `LowerToHighLevelFIR` lowering option, and the
descriptor-discretization debug switch:

- `-flang-experimental-hlfir` and `-flang-deprecated-no-hlfir` (flang
  driver and `-fc1`)
- `-hlfir` / `--hlfir` (bbc)
- `--use-desc-for-alloc` (bbc, debug)

Remove every `if (lowerToHighLevelFIR()) { ... } else { ... }` branch in
`lib/Lower/`, keeping the HLFIR side. Delete the now-unused legacy
helpers in `Bridge.cpp` (`copyVarFIR`, both
`genNoHLFIRPointerAssignment`
overloads, the legacy block of `genAssignment`) and the always-empty
`createMutableProperties` together with its four dead helpers in
`Allocatable.cpp`. Drop the corresponding `alwaysUseBox` parameter from
`createMutableBox`.

    [4 lines not shown]
DeltaFile
+107-572flang/lib/Lower/Bridge.cpp
+5-139flang/lib/Lower/Allocatable.cpp
+28-80flang/lib/Lower/ConvertVariable.cpp
+1-29flang/lib/Lower/ConvertType.cpp
+7-13flang/lib/Lower/ConvertCall.cpp
+0-19flang/lib/Frontend/CompilerInvocation.cpp
+148-8529 files not shown
+159-91415 files

LLVM/project d2bc838llvm/test/Transforms/LoopVectorize early-exit-umin-trip-count.ll

[SE][LV] Add test: early-exit loop with umin trip count should vectorize (NFC) (#196942)

See https://github.com/llvm/llvm-project/issues/196935
DeltaFile
+77-0llvm/test/Transforms/LoopVectorize/early-exit-umin-trip-count.ll
+77-01 files

LLVM/project 693ad7ellvm/unittests/IR LegacyPassManagerTest.cpp

[NFC][LLVM] Namespace cleanup in LegacyPassManagerTest (#196811)

Remove llvm namespace surrounding the entire file, and remove extra
indentation of the code within the anonymous namespace.
DeltaFile
+573-578llvm/unittests/IR/LegacyPassManagerTest.cpp
+573-5781 files

LLVM/project a4c4836llvm/unittests/IR TimePassesTest.cpp InstructionsTest.cpp

[NFC][LLVM][IRTests] Namespace cleanup (#196806)

Remove llvm namespace surrounding entire .cpp files and instead use
`using namespace` in these files.
DeltaFile
+5-4llvm/unittests/IR/TimePassesTest.cpp
+3-3llvm/unittests/IR/InstructionsTest.cpp
+2-2llvm/unittests/IR/BasicBlockTest.cpp
+2-2llvm/unittests/IR/ConstantsTest.cpp
+0-3llvm/unittests/IR/DroppedVariableStatsIRTest.cpp
+1-2llvm/unittests/IR/VerifierTest.cpp
+13-166 files

LLVM/project 30bda9fclang/lib/AST/ByteCode Compiler.cpp, clang/test/AST/ByteCode c.c

[clang][bytecode] Check value-dependency before calling evaluateValue() (#196931)

As always.
DeltaFile
+9-0clang/test/AST/ByteCode/c.c
+3-2clang/lib/AST/ByteCode/Compiler.cpp
+12-22 files

LLVM/project 9121760lldb/source/Host/common Editline.cpp

[lldb] Release output lock across blocking el_wgetc in DisplayCompletions (#196686)

DisplayCompletions held m_output_stream_sp->Lock() across the blocking
el_wgetc() call used by the "More (Y/n/a)" pager. Because the lock is a
recursive_mutex, this worked when Editline::Interrupt() ran on the same
thread (the synchronous SIGINT handler), but deadlocks when Interrupt()
runs on another thread: it blocks on the lock and can never call
InterruptRead() to wake the editor thread.

Mirror the pattern already used by Editline::GetCharacter: drop the lock
across the blocking read and reacquire it afterward. The status check
and the "^C\n" / "\n" prints stay under the lock.
DeltaFile
+16-6lldb/source/Host/common/Editline.cpp
+16-61 files

LLVM/project 86aa07allvm/include/llvm/IR IRBuilder.h, llvm/lib/Target/RISCV RISCVGatherScatterLowering.cpp

[InstCombine] Create `or` as `disjoint` where applicable (#193725)
DeltaFile
+6-7llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+2-2llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+4-0llvm/include/llvm/IR/IRBuilder.h
+2-2llvm/test/Transforms/InstCombine/add.ll
+1-1llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+15-125 files

LLVM/project 29df070llvm/lib/CodeGen StackColoring.cpp, llvm/test/CodeGen/X86 sjlj-do-not-merge-stack-slots.ll

[StackColoring] Treat all stack slots as conservative with `returns_twice` call-sites (#196542)

Do not merge stack slots on disjoint paths if the function may call
setjmp/sigsetjmp, as the current algorithm defaults to computing
liveness analysis from the actual uses propagated through the CFG,
rather than leveraging lifetime markers, thus making it unsound with
`returns_twice` calls.

Fixes: https://github.com/llvm/llvm-project/issues/196468.
DeltaFile
+5-4llvm/test/CodeGen/X86/sjlj-do-not-merge-stack-slots.ll
+5-0llvm/lib/CodeGen/StackColoring.cpp
+10-42 files

LLVM/project 58aa43fllvm/lib/Transforms/IPO AlwaysInliner.cpp, llvm/test/Transforms/Inline flatten.ll

Revert "[LLVM] Fix use-after-free in AlwaysInliner flatten worklist" (#196950)

Reverts llvm/llvm-project#194485, which causes a 20x+ compilation time
increase
(https://github.com/llvm/llvm-project/pull/194485#issuecomment-4416941666)
and an up to 20% runtime performance regression on fleetbench memory
benchmarks
(https://github.com/llvm/llvm-project/pull/194485#issuecomment-4421136222).
DeltaFile
+42-39llvm/lib/Transforms/IPO/AlwaysInliner.cpp
+0-38llvm/test/Transforms/Inline/flatten.ll
+42-772 files

LLVM/project 58988bdllvm/test/CodeGen/AMDGPU/GlobalISel legalize-load-private.mir legalize-llvm.amdgcn.image.sample.a16.ll

AMDGPU/GlobalISel: Switch to extended LLTs

Switch is required to be able to translate bfloat.

After the switch most of the codegen patterns now require explicit
type on register to match instead of LLT::scalar.
So we can still use LLT::scalar for type checks but new instructions
created during lowerings/combines need to use propper extended LLT.

inst select test sources fully switched to i32/f32 so patterns can match
for legalizer and regbanklegalize left as is (should probably be switched
as well)

New functionality worth noting is f16 and bitcast lowering to i32
f16 = g_bitcast i16
->
i32 = g_anyext i16
f16 = g_trunc i32

f16 = trunc i32 is legal
DeltaFile
+6,753-6,685llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-private.mir
+5,732-5,732llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+5,570-5,519llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+5,045-5,045llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-store-global.mir
+5,017-4,999llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+3,948-3,900llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.dim.a16.ll
+32,065-31,880581 files not shown
+107,207-104,841587 files

LLVM/project fd84e79mlir/docs Tokens.md, mlir/lib/Conversion/AsyncToLLVM AsyncToLLVM.cpp

[mlir][IR] Add builtin `TokenTypeInterface`

type instead of type interface

add bytecode
DeltaFile
+104-0mlir/docs/Tokens.md
+36-24mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
+60-0mlir/test/IR/token-type.mlir
+18-17mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
+30-0mlir/test/lib/Dialect/Test/TestOps.td
+12-12mlir/test/Dialect/SparseTensor/invalid.mlir
+260-5324 files not shown
+365-9530 files

LLVM/project 6443657clang/docs ReleaseNotes.rst, clang/lib/AST ExprCXX.cpp

[clang][AST] Teach `CXXTypeidExpr::isMostDerived` to use `isEffectivelyFinal` (#196544)

Resolves #196476.

When a class is marked final, typeid on references to that type can be
resolved at compile time since the most-derived type is statically
known.
DeltaFile
+57-0clang/test/CodeGenCXX/typeid-most-derived.cpp
+5-0clang/lib/AST/ExprCXX.cpp
+3-0clang/docs/ReleaseNotes.rst
+65-03 files

LLVM/project dd907edllvm/test/CodeGen/X86 sjlj-do-not-merge-stack-slots.ll

[StackColoring] Introduce test for PR196542 (NFC) (#196951)
DeltaFile
+49-0llvm/test/CodeGen/X86/sjlj-do-not-merge-stack-slots.ll
+49-01 files

LLVM/project fd30f5bclang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenDeclCXX.cpp

[CIR] Implement Namespace/global TLS CIR CodeGen (#196332)

Unlike local TLS, global TLS functions need to be initialized upon their
first use in a thread.

First, all attempts to 'get' said TLS global are replaced with calls to
a 'wrapper' function, which calls an 'init' alias function, then returns
the global. While classic codegen manages to omit this in simple cases
sometimes, this CIR implementation doesn't attempt to do such constant
folding/inlining. The call to the 'init' is omitted if there is no
ctor/dtor setup required, so sometimes the wrapper is just a 'no-op'
(intentionally!).

There are also two types of 'global' TLS functions: unordered, and
ordered. Unordered are typically variable templates, and their 'init'
function initializes JUST them. The rest are ordered, which requires all
ordered initializations to happen as soon as any happen.

The Wrapper:

    [25 lines not shown]
DeltaFile
+65-0clang/test/CIR/CodeGen/global-tls-simple-init.cpp
+59-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+50-0clang/test/CIR/CodeGen/global-tls-dyn-init.cpp
+39-0clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp
+34-0clang/test/CIR/CodeGen/global-tls-templates.cpp
+18-0clang/test/CIR/IR/invalid-tls.cir
+265-06 files not shown
+294-1612 files

LLVM/project b150adallvm/test/CodeGen/AMDGPU/GlobalISel legalize-load-private.mir legalize-llvm.amdgcn.image.sample.a16.ll

AMDGPU/GlobalISel: Switch to extended LLTs

Switch is required to be able to translate bfloat.

After the switch most of the codegen patterns now require explicit
type on register to match instead of LLT::scalar.
So we can still use LLT::scalar for type checks but new instructions
created during lowerings/combines need to use propper extended LLT.

inst select test sources fully switched to i32/f32 so patterns can match
for legalizer and regbanklegalize left as is (should probably be switched
as well)

New functionality worth noting is f16 and bitcast lowering to i32
f16 = g_bitcast i16
->
i32 = g_anyext i16
f16 = g_trunc i32

f16 = trunc i32 is legal
DeltaFile
+6,753-6,685llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-private.mir
+5,732-5,732llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+5,570-5,519llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+5,045-5,045llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-store-global.mir
+5,017-4,999llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+3,948-3,900llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.dim.a16.ll
+32,065-31,880581 files not shown
+107,437-105,033587 files

LLVM/project fe69360llvm/lib/Transforms/IPO AlwaysInliner.cpp, llvm/test/Transforms/Inline flatten.ll

Revert "[LLVM] Fix use-after-free in AlwaysInliner flatten worklist (#194485)"

This reverts commit b40c1d511b2e84842707939a1332b90ebb1a50a0.
DeltaFile
+42-39llvm/lib/Transforms/IPO/AlwaysInliner.cpp
+0-38llvm/test/Transforms/Inline/flatten.ll
+42-772 files

LLVM/project b9613dcclang/include/clang/Basic TargetInfo.h, clang/lib/AST ASTContext.cpp

convert to exec-charset inside getPredefinedStringLiteralFromCache, test __builtin_FILE()
DeltaFile
+28-0clang/test/CodeGen/systemz-charset.cpp
+10-0clang/lib/AST/ASTContext.cpp
+5-4clang/lib/Lex/TextEncodingConfig.cpp
+3-0clang/lib/Basic/TargetInfo.cpp
+2-0clang/include/clang/Basic/TargetInfo.h
+48-45 files

LLVM/project c687b82clang/docs LanguageExtensions.rst, clang/include/clang/Options Options.td

Enable driver changes for fexec-charset
DeltaFile
+14-6clang/lib/Driver/ToolChains/Clang.cpp
+14-4clang/include/clang/Options/Options.td
+11-3clang/test/Driver/clang_f_opts.c
+10-0llvm/lib/Support/TextEncoding.cpp
+4-3clang/test/Driver/cl-options.c
+3-3clang/docs/LanguageExtensions.rst
+56-193 files not shown
+60-199 files

LLVM/project 390277bclang/lib/AST PrintfFormatString.cpp FormatString.cpp, clang/lib/Sema SemaChecking.cpp

Add format string handling
DeltaFile
+58-31clang/lib/AST/PrintfFormatString.cpp
+46-40clang/lib/AST/FormatString.cpp
+33-21clang/lib/Sema/SemaChecking.cpp
+25-11clang/lib/AST/FormatStringParsing.h
+15-8clang/lib/AST/ScanfFormatString.cpp
+19-0llvm/lib/Support/TextEncoding.cpp
+196-11111 files not shown
+257-12117 files

LLVM/project ad90e98clang/include/clang/Sema Sema.h

Fix build failure
DeltaFile
+1-0clang/include/clang/Sema/Sema.h
+1-01 files

LLVM/project 9830c43clang/lib/AST/ByteCode Descriptor.cpp, clang/test/AST/ByteCode literals.cpp

[clang][bytecode] Fix a crash in Descriptor::getElemDataSize() (#196929)

`FIXED_SIZE_INT_TYPE_SWITCH` does not handle `PT_Bool`, handle it
explicitly before.
DeltaFile
+4-0clang/test/AST/ByteCode/literals.cpp
+2-0clang/lib/AST/ByteCode/Descriptor.cpp
+6-02 files

LLVM/project 9a3193bclang/lib/CodeGen CGOpenMPRuntime.cpp CGExpr.cpp, clang/lib/Sema SemaOpenMP.cpp

[clang][OpenMP 6.0][CodeGen] Codegen for declare_target 'local' clause (#196431)

Implement code generation for the OpenMP 6.0 declare_target 'local'
clause, which creates device-only variables with per-device static
storage.

A 'local' variable exists in the device image with its static
initializer and is always accessed directly by device code. This is the
same as 'to'/'enter' without unified shared memory, except that no
offload entry is registered.

Using 'device_type(nohost)' with 'local' is not yet supported. Sema
generates a warning and converts it to 'device_type(any)'.

Testing:
- Updated tests:
     clang/test/OpenMP/declare_target_messages.cpp
     clang/test/OpenMP/declare_target_ast_print.cpp
- New tests:

    [2 lines not shown]
DeltaFile
+430-0clang/test/OpenMP/declare_target_local_codegen.cpp
+52-0clang/test/OpenMP/declare_target_local_usm_codegen.cpp
+40-0offload/test/offloading/declare_target_local.cpp
+16-10clang/lib/CodeGen/CGOpenMPRuntime.cpp
+9-10clang/lib/CodeGen/CGExpr.cpp
+10-5clang/lib/Sema/SemaOpenMP.cpp
+557-256 files not shown
+581-4712 files

LLVM/project 0aa4619llvm/utils/gn/secondary/clang/lib/CodeGen BUILD.gn, llvm/utils/gn/secondary/llvm/lib/ABI BUILD.gn

[gn] port 07b5dfe9473c6 + deps (LLVMABI dep in clang) (#196944)

Also adds build files for llvm/lib/ABI, which was dead code before
07b5dfe9473c6 (at least in the GN build).
DeltaFile
+15-0llvm/utils/gn/secondary/llvm/lib/ABI/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/lib/CodeGen/BUILD.gn
+16-02 files

LLVM/project 2243f63llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

[AMDGPU] Replace vdst_in opcode exclusion list with position check

Use getNamedOperandIdx to detect if vdst_in has already been added
by a prior converter, instead of maintaining a hardcoded opcode list.
DeltaFile
+6-42llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+6-421 files

LLVM/project a9257f7clang/docs ReleaseNotes.rst, clang/test/CodeGenCXX typeid-most-derived.cpp

address review comments
DeltaFile
+14-14clang/test/CodeGenCXX/typeid-most-derived.cpp
+3-0clang/docs/ReleaseNotes.rst
+17-142 files

LLVM/project 75813d0llvm/lib/Transforms/Vectorize LoopVectorizationPlanner.cpp, llvm/test/Transforms/LoopVectorize if-conversion-scalable.ll

[LV] Add test showing lack of gather/scatter can prevent if-convert

This introduces a new force-target-supports-gather-scatter-ops CLI
option for testing, as well a new isLegalMaskedLoadOrStore() helper.
DeltaFile
+120-0llvm/test/Transforms/LoopVectorize/if-conversion-scalable.ll
+7-1llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.cpp
+127-12 files

LLVM/project bc2dedbclang/lib/AST ExprCXX.cpp, clang/test/CodeGenCXX typeid-most-derived.cpp

[clang][AST] Teach `CXXTypeidExpr::isMostDerived` to use `isEffectivelyFinal`
DeltaFile
+57-0clang/test/CodeGenCXX/typeid-most-derived.cpp
+5-0clang/lib/AST/ExprCXX.cpp
+62-02 files

LLVM/project b4e8f59mlir/lib/Conversion/MathToSPIRV MathToSPIRV.cpp, mlir/test/Conversion/MathToSPIRV math-to-opencl-spirv.mlir

[mlir][SPIR-V] Lower math.{exp2,log2,log10} operations (#196723)
DeltaFile
+8-12mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir
+3-2mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
+11-142 files