LLVM/project f0adfabllvm/test/Transforms/SLPVectorizer/X86 scalarize-ctlz.ll arith-fp-inseltpoison.ll

[SLP] Preserve profitable trees when subtree trimming would reduce to buildvector-only

In calculateTreeCostAndTrimNonProfitable, the subtree trim loop returns
Invalid when trimming node Idx==1 under an InsertElement root would
leave only a buildvector, to avoid infinite vectorization attempts.
This is too aggressive when the original untrimmed tree is already
profitable (Cost < -SLPCostThreshold). In that case, undo any partial
trims and return the original cost instead of rejecting the tree.

Reviewers: RKSimon, hiraditya, bababuck

Pull Request: https://github.com/llvm/llvm-project/pull/197763
DeltaFile
+48-29llvm/test/Transforms/SLPVectorizer/X86/scalarize-ctlz.ll
+19-32llvm/test/Transforms/SLPVectorizer/X86/arith-fp-inseltpoison.ll
+19-32llvm/test/Transforms/SLPVectorizer/X86/arith-fp.ll
+9-10llvm/test/Transforms/SLPVectorizer/X86/deleted-instructions-clear.ll
+7-10llvm/test/Transforms/SLPVectorizer/X86/alternate-int-inseltpoison.ll
+7-10llvm/test/Transforms/SLPVectorizer/X86/alternate-int.ll
+109-1234 files not shown
+138-14010 files

LLVM/project c8dcb79clang/test/SemaCXX warn-unsafe-buffer-usage-pragma-issue-79379.cpp warn-unsafe-buffer-usage-pragma-diagnostic.cpp

rename the test for a github issue with the issue number
DeltaFile
+25-0clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-issue-79379.cpp
+0-25clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-diagnostic.cpp
+25-252 files

LLVM/project bf7d6fellvm/utils/gn/secondary/llvm/lib/MC BUILD.gn

[gn build] Port ca6e386cbf5b (#198009)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/MC/BUILD.gn
+1-01 files

LLVM/project e0b3a79llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn] port 597e4ac7fbdd, 2nd attempt (#198008)
DeltaFile
+1-2llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+1-21 files

LLVM/project c5d66ebllvm/utils/gn/secondary/libcxx/include BUILD.gn

Revert "[gn] port 597e4ac7fbdd (#198002)" (#198007)

This reverts commit 845dd45d82dac9902bd5665f7ac8f276e218df20.

I merged this incorrectly. Let's revert and try again.
DeltaFile
+2-1llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+2-11 files

LLVM/project cbc5657llvm/test/CodeGen/SPIRV/debug-info debug-type-function-pointer-param.ll debug-type-function-int-string-dedup.ll

[reviews] Simplify tests.
DeltaFile
+7-7llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-pointer-param.ll
+7-7llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-int-string-dedup.ll
+7-7llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-scalar-returns.ll
+6-6llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-void-prototypes.ll
+1-1llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-multi-scalar-params.ll
+1-1llvm/test/CodeGen/SPIRV/debug-info/debug-type-function-subroutine-type-flags.ll
+29-292 files not shown
+31-318 files

LLVM/project 251eba7llvm/utils/gn/secondary/llvm/lib/Transforms/IPO BUILD.gn

[gn build] Port b225b33c925c (#198004)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Transforms/IPO/BUILD.gn
+1-01 files

LLVM/project 845dd45llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn] port 597e4ac7fbdd (#198002)
DeltaFile
+1-2llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+1-21 files

LLVM/project 18c6e26clang/test/SemaCXX warn-unsafe-buffer-usage-template-instantiation-notes.cpp warn-unsafe-buffer-usage-pragma-diagnostic.cpp

- Add test for rdar://107480207
- Add test for https://github.com/llvm/llvm-project/issues/79379
DeltaFile
+47-0clang/test/SemaCXX/warn-unsafe-buffer-usage-template-instantiation-notes.cpp
+25-0clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-diagnostic.cpp
+72-02 files

LLVM/project 9244772llvm/test/MC/Disassembler/AMDGPU gfx11_dasm_vop3.txt gfx12_dasm_vop3.txt

[AMDGPU] Use shorter form for i16 operands

For 16-bit operands an inline constant is zero extended
which in particular allows to use FP constants. These
will have 16 bits of zeroes in the high half and FP16
value in the low 16 bits.
DeltaFile
+200-200llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_vop3.txt
+200-200llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_vop3.txt
+116-116llvm/test/MC/Disassembler/AMDGPU/gfx9_vop3.txt
+98-98llvm/test/MC/Disassembler/AMDGPU/gfx10_vop3.txt
+96-96llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_vopc.txt
+96-96llvm/test/MC/Disassembler/AMDGPU/gfx10_vop3c.txt
+806-80655 files not shown
+2,169-2,16661 files

LLVM/project a96572aflang-rt/lib/runtime findloc.cpp

[flang-rt] Rework findloc.cpp to dispatch target at runtime (#197756)

Summary:
The previous code had a combinatorial explosion of functions by
templating on both the source and target types. This created around 170
instantiations. Instead we just template on the source type and then use
a simple runtime check. This should not affect performance in a
significant way, it introduces maybe a few branches in what is already a
non-trivial operation that I do not think justifies a two-minute compile
time.

The result is that this file goes from 120 seconds to 12 on my machine
and the resulting file goes from 7.2 MiB to 757 kiB. Functinally this
makes us instantiate 1/10th the functions.
DeltaFile
+110-68flang-rt/lib/runtime/findloc.cpp
+110-681 files

LLVM/project 62a0704llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp, llvm/test/CodeGen/SPIRV/debug-info debug-type-pointer-composite-pointee.ll

[reviews] Simplify code and add missing test.
DeltaFile
+38-0llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer-composite-pointee.ll
+9-11llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+47-112 files

LLVM/project 13dc18allvm/test/tools/dsymutil/AArch64 cas-config.test, llvm/tools/dsymutil DwarfLinkerForBinary.cpp

[dsymutil] Collect .cas-config files in dSYM bundles (#197818)

When caching is enabled the Swift compiler might substitute CAS
identifiers for on-disk paths. In order to resolve them the build system
puts a .cas-config file in the build directory. Dsymutil needs to
collect the contents of these files so tools consuming the dSYM (which
do not have access to the original build directory) can resolve these
CAS identifiers, too.

Assisted-by: claude

rdar://169986664
DeltaFile
+50-2llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+36-0llvm/test/tools/dsymutil/AArch64/cas-config.test
+86-22 files

LLVM/project 91026ccllvm/lib/Target/AMDGPU SIISelLowering.cpp SIInstructions.td, llvm/test/CodeGen/AMDGPU fcanonicalize.bf16.ll packed-fneg-fsub-bf16.ll

[AMDGPU] Optimize fcanonicalize/fneg/fsub with packed bf16 math ops (#197318)

  This work makes fcanonicalize v2bf16 'Legal' and implements the
selection pattern for it with v_pk_mul_bf16.

  We also make fneg and fabs 'Legal' in this patch. With this change,
packed fadd can be selected for vector fsub with bf16. Also, the vector
fneg can be successfully folded into the operand in the packed bf16 math ops.
DeltaFile
+197-580llvm/test/CodeGen/AMDGPU/fcanonicalize.bf16.ll
+533-0llvm/test/CodeGen/AMDGPU/packed-fneg-fsub-bf16.ll
+9-30llvm/test/CodeGen/AMDGPU/bf16.ll
+6-7llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+6-0llvm/lib/Target/AMDGPU/SIInstructions.td
+751-6175 files

LLVM/project 2c20ffbllvm/lib/Target/AArch64 MachineSMEABIPass.cpp, llvm/test/CodeGen/AArch64 sme-abi-debug.ll

[AArch64] Do not pass debug insn to liveness analysis (#197989)

This time in the MachineSMEABIPass, where we can skip any debug
instructions. See #193104.
DeltaFile
+37-0llvm/test/CodeGen/AArch64/sme-abi-debug.ll
+3-0llvm/lib/Target/AArch64/MachineSMEABIPass.cpp
+40-02 files

LLVM/project 582fd84llvm/test/CodeGen parse-cfi-unsigned-error.mir, llvm/test/CodeGen/MIR/AMDGPU parse-cfi-unsigned-error.mir

[AMDGPU] Move test to CodeGen/AMDGPU (#197993)

This test is AMDGPU specific and we generally do not have any tests in
top-level test/CodeGen.
DeltaFile
+11-0llvm/test/CodeGen/MIR/AMDGPU/parse-cfi-unsigned-error.mir
+0-11llvm/test/CodeGen/parse-cfi-unsigned-error.mir
+11-112 files

LLVM/project ef70845lldb/include/lldb/Host Socket.h, lldb/include/lldb/Host/common UDPSocket.h

[lldb][NFC] Socket::Send should return a signed type (#197844)

The underlying `::send` and `::sendto` returns `ssize_t` on macOS/Linux
and `int` on Windows. These functions also commmunicate an error through
returning -1 (which is not expressible in a size_t).
DeltaFile
+1-1lldb/source/Host/common/Socket.cpp
+1-1lldb/include/lldb/Host/Socket.h
+1-1lldb/include/lldb/Host/common/UDPSocket.h
+1-1lldb/source/Host/common/UDPSocket.cpp
+4-44 files

LLVM/project cd14c88llvm/lib/Transforms/Utils CodeExtractor.cpp, llvm/test/Transforms/HotColdSplit issue-197982.ll single-output-multiple-users.ll

[CodeExtractor] fix use list iterator invalidation (#197986)

Fix crash in HotColdSplit that uses CodeExtractor to outline cold
functions from https://github.com/llvm/llvm-project/pull/191824.

When `CodeExtractor::insertReplacerCall` replaces the outlined function
return value, calling `replaceUsesOfWith` invalidates the users iterator
causing the loop exit early without having replaced all of the original users
of `FuncRetVal`.
```
Referring to an instruction in another function!
  %s.sroa.0.0 = phi ptr [ %call.i, %codeRepl ], [ undef, %entry ]
LLVM ERROR: Broken module found, compilation aborted!
```

Reproducer: https://godbolt.org/z/G5qv35nnq
DeltaFile
+132-0llvm/test/Transforms/HotColdSplit/issue-197982.ll
+37-0llvm/test/Transforms/HotColdSplit/single-output-multiple-users.ll
+3-5llvm/lib/Transforms/Utils/CodeExtractor.cpp
+172-53 files

LLVM/project cd80fc0llvm/test/CodeGen/ARM debug-step-backward.ll

[ARM][NFC] Test that debug insns are not passed to stepBackward (#197976)

Test that debug insns are not passed to stepBackward. This testcase
shows the necessity of https://github.com/llvm/llvm-project/pull/197769.

Signed-off-by: John Lu <John.Lu at amd.com>
DeltaFile
+32-0llvm/test/CodeGen/ARM/debug-step-backward.ll
+32-01 files

LLVM/project c842538llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp SPIRVNonSemanticDebugHandler.h

Fix handling for DebugTypeFunction.
DeltaFile
+12-7llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+13-2llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+25-92 files

LLVM/project 19d7856flang/lib/Lower/OpenMP Utils.cpp ClauseProcessor.cpp, flang/lib/Optimizer/OpenMP MapInfoFinalization.cpp

[Flang][OpenMP] Support iterator modifiers in map and motion clauses

Support iterated array elements and array sections in map and motion clauses for
target data, target enter data, target exit data, and target update constructs.

Preserve mapper resolution for iterated entries, including explicit mappers,
user-defined default mappers, declare mapper entries, and implicit default
mappers.

This PR stacked on top of #197047 and #197752.

This patch is part of the feature work for #188061.

Assisted with copilot.
DeltaFile
+507-0flang/test/Lower/OpenMP/motion-iterator.f90
+183-0flang/lib/Lower/OpenMP/Utils.cpp
+96-12flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+25-0flang/test/Lower/OpenMP/declare-mapper-iterator.f90
+15-0flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+13-0flang/lib/Lower/OpenMP/Utils.h
+839-123 files not shown
+839-399 files

LLVM/project 3cfc7aelldb/source/API SBPlatform.cpp SBTarget.cpp, lldb/source/Commands CommandObjectType.cpp CommandObjectBreakpoint.cpp

[lldb] Make use of ConstString(StringRef) where applicable (NFC) (#197954)

Replace `ConstString(char *)`, mostly with the `StringRef` constructor.
Eliminates some unnecessary `strlen`, and a few copies.
DeltaFile
+9-9lldb/source/Commands/CommandObjectType.cpp
+7-7lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+7-7lldb/source/API/SBPlatform.cpp
+6-6lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+4-5lldb/source/API/SBTarget.cpp
+3-4lldb/source/Commands/CommandObjectBreakpoint.cpp
+36-3827 files not shown
+70-7433 files

LLVM/project fc3457dflang-rt/lib/runtime extrema.cpp matmul-transpose.cpp

[flang-rt] Move template parameters to runtime to improve compile times (#197738)

Summary:
These files take an extraordinarily long amount of time to compile. This
is due to the combinatorial explosino of template parameters. This PR
takes a few choice factors and puts them as runtime components instead.
This should have no real impact on runtime with optimizations, but
brings the compilation for these from 60s each to 30s on my machine. A
future PR will split these up by component so we get more build-system
parallelism.
DeltaFile
+28-41flang-rt/lib/runtime/extrema.cpp
+17-20flang-rt/lib/runtime/matmul-transpose.cpp
+16-19flang-rt/lib/runtime/matmul.cpp
+61-803 files

LLVM/project 609ce47clang/lib/Sema AnalysisBasedWarnings.cpp, clang/test/Modules safe_buffers_optout.cpp

[-Wunsafe-buffer-usage] Warning-only analysis no longer re-analyzes pre-compiled code

Move the warning-only analysis back to the end of parsing each Decl.
The warning-only analysis no longer does any extra AST deserialization.
Pre-compiled code will only be analyzed once during its own compilation.

When `-fsafe-buffer-usage-suggestions` is used, the behavior is the
same as before, because it requires visibility of the whole
translation unit.

rdar://177185295
DeltaFile
+67-30clang/lib/Sema/AnalysisBasedWarnings.cpp
+43-49clang/test/Modules/safe_buffers_optout.cpp
+26-13clang/test/PCH/unsafe-buffer-usage-pragma-pch-complex.cpp
+14-5clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-pch.cpp
+10-6clang/test/PCH/unsafe-buffer-usage-pragma-pch-cross-files-2.cpp
+10-5clang/test/PCH/unsafe-buffer-usage-pragma-pch-cross-files.cpp
+170-1081 files not shown
+184-1087 files

LLVM/project 5f78a53libc/src/__support/File file.cpp file.h, libc/src/wchar ungetwc.cpp ungetwc.h

[libc] implement ungetwc (#196162)

Add ungetwc function and tests. Part 6/10.

Assisted by Gemini
DeltaFile
+275-0libc/test/src/wchar/ungetwc_test.cpp
+39-0libc/src/wchar/ungetwc.cpp
+28-0libc/src/wchar/ungetwc.h
+12-4libc/test/src/__support/File/file_test.cpp
+3-2libc/src/__support/File/file.cpp
+2-2libc/src/__support/File/file.h
+359-85 files not shown
+369-1211 files

LLVM/project 1c5e395llvm/test/Transforms/SLPVectorizer/X86 arith-mul-smulo.ll arith-sub-ssubo.ll

[SLP] Vectorize struct-returning intrinsics

Allow SLP to combine across lanes calls that return a literal struct
(llvm.sincos, llvm.*.with.overflow, llvm.frexp, ...) into a single
call returning a struct of vectors, by widening {T, T, ...} to
{<VF x T>, ...} via VectorTypeUtils and emitting extractvalue +
extractelement for external uses.

Original Pull Request: https://github.com/llvm/llvm-project/pull/195521

Original Pull Request2: https://github.com/llvm/llvm-project/pull/196756

Recommit after revert https://github.com/llvm/llvm-project/pull/197969

Added check for valid vectorizable type.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/197994
DeltaFile
+549-615llvm/test/Transforms/SLPVectorizer/X86/arith-mul-smulo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-sub-ssubo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-sub-usubo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-add-saddo.ll
+449-615llvm/test/Transforms/SLPVectorizer/X86/arith-add-uaddo.ll
+429-615llvm/test/Transforms/SLPVectorizer/X86/arith-mul-umulo.ll
+2,774-3,6905 files not shown
+3,290-3,91311 files

LLVM/project 7bbff84.ci compute_projects.py

[CI] Remove duplicate entries in PROJECT_CHECK_TARGETS (NFC) (#197833)
DeltaFile
+0-2.ci/compute_projects.py
+0-21 files

LLVM/project 8380423lldb/packages/Python/lldbsuite/test decorators.py

[lldb][test] Don't overwrite existing decorators in _skipForVariant (#197409)

_skipForVariant uses a dictionary to save the decorator functions for
specific variants. However, if the dictionary already contains a
decorator function, then that decorator is overwritten in the current
implementation.

This means that if we have two decorators that skip a variant in
combination with another check, then the second decorator overwrites the
first one and is effectively ignored.

Downstream we are hit by this because we have an embedded Swift variant.
If we skip this variant for both Linux and Windows, then depending on
the decorator order we still run the test on one of those two platforms
(as one decorator is overwritten by the other).
DeltaFile
+12-1lldb/packages/Python/lldbsuite/test/decorators.py
+12-11 files

LLVM/project 1724803compiler-rt/test/safestack sigaltstack.c

[safestack][test] Fix sigaltstack.c on Solaris (#197967)

The `SafeStack-Standalone-*:: sigaltstack.c` test `FAIL`s on Solaris. It
uses `MAP_STACK` which is unportable and on glibc systems just a no-op.
Therefore this patch provides a fallback definition.

Tested on `x86_64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
DeltaFile
+5-0compiler-rt/test/safestack/sigaltstack.c
+5-01 files

LLVM/project 961676cllvm/lib/CodeGen/AsmPrinter CodeViewDebug.cpp, llvm/test/DebugInfo/COFF builtin-verbose-trap.ll

[CodeView] Generate debug info for artificial subprograms (#196327)

Based on https://clang.llvm.org/docs/AttributeReference.html#artificial,
Artificial subprograms are not required to have a non-zero line number
location, so don't ignore them.

Fix #195768
DeltaFile
+64-0llvm/test/DebugInfo/COFF/builtin-verbose-trap.ll
+14-3llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+78-32 files