LLVM/project 7bf820cllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 ordered-reduction-root-deleted.ll

[SLP] Fix crash in ordered reduction with loop-carried chain root

tryToReduceOrdered built the buildTree ignore list only from the current
window's reduced values, omitting the chain root when its leaf is a
trailing scalar outside the window.
buildTree then vectorized the root through the phi cycle,
vectorizeTree unlinked it, and emitReduction inserted at the dangling
insertion point.
Build the ignore list from the full ReductionOps chain, matching the
associative-reduction path, so the root stays scalar to fix a crash.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/201963
DeltaFile
+70-0llvm/test/Transforms/SLPVectorizer/X86/ordered-reduction-root-deleted.ll
+6-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+76-32 files

LLVM/project 985e499libclc/test update_libclc_tests.py

[libclc][Test] Don't hard code `clang` path in update_libclc_tests.py (#201806)

In #201773, build folder is `redhat-linux-build` rather than `build`.
Detect clang from PATH. Also add --clang-binary option to specify clang path.
DeltaFile
+27-5libclc/test/update_libclc_tests.py
+27-51 files

LLVM/project e8753fdlibclc/test/conversion convert.cl, libclc/test/geometric cross.cl

[libclc][Test] Add -fno-discard-value-names to RUN line (#201808)

Entry block label could be missing. Add -fno-discard-value-names to make
sure it exists.

Resolves #201773
DeltaFile
+1-1libclc/test/conversion/convert.cl
+1-1libclc/test/geometric/cross.cl
+1-1libclc/test/integer/add_sat.cl
+1-1libclc/test/integer/sub_sat.cl
+1-1libclc/test/math/cos.cl
+1-1libclc/test/math/fabs.cl
+6-63 files not shown
+9-99 files

LLVM/project 517a075libclc CMakeLists.txt

[libclc] Fix LIBCLC_OUTPUT_LIBRARY_DIR when find_package(LLVM) fails (#201816)

If we configure llvm from llvm-project/build folder, find_package(LLVM)
succeeds, `LLVM_LIBRARY_OUTPUT_INTDIR` is `build/./lib` and
`LLVM_BINARY_DIR` is `build`.

However, in #201773, find_package(LLVM) fails due to
LLVM_LIBDIR_SUFFIX=64, LLVM_LIBRARY_OUTPUT_INTDIR is
`redhat-linux-build/runtimes/runtimes-nvptx64-nvidia-cuda-bins/lib64`
and LLVM_BINARY_DIR is `redhat-linux-build`.

Use LLVM_BINARY_DIR, which is stable for both cases, for libclc output dir.

Fixes #201773
DeltaFile
+3-3libclc/CMakeLists.txt
+3-31 files

LLVM/project 961d5b8libc/src/__support/time/linux clock_gettime.cpp

[libc] Fix clock_gettime on arm32 (#201959)

After removing 32 bit time_t the buildbot has been failing due to a
segfault. This PR fixes it. Not the cleanest fix but I don't want the
buildbot failing over the weekend.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+22-5libc/src/__support/time/linux/clock_gettime.cpp
+22-51 files

LLVM/project b7152ffutils/bazel/llvm-project-overlay/clang BUILD.bazel

[Bazel] Fixes 8aafa50 (#201958)

This fixes 8aafa50c7a2dfb8ca1d5cdf8980f7f2d259779f5.

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+1-01 files

LLVM/project f90e1f7llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR inline-asm.mir

AMDGPU/UniformityAnalysis: Test MIR uniformity analysis for INLINEASM

Resolves to always uniform at the moment.
DeltaFile
+60-0llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/inline-asm.mir
+60-01 files

LLVM/project 8aafa50clang/test/OffloadTools/clang-sycl-linker link.ll basic.ll, clang/tools/clang-nvlink-wrapper ClangNVLinkWrapper.cpp

[clang][sycl][nvlink] Share static library linking in Frontend/Offloading (#201253)

Move clang-nvlink-wrapper's archive member selection engine into a new
shared library in llvm/lib/Frontend/Offloading (ArchiveLinker.h/.cpp)
and use it from both clang-nvlink-wrapper and clang-sycl-linker, adding
static library (.a) and -l support to the SYCL linker.

The shared llvm::offloading::resolveArchiveMembers() API:
- Searches -L paths for -l library names (lib<name>.a or :<name>)
- Expands archives, honouring --whole-archive/--no-whole-archive
- Runs a symbol-driven fixed-point loop to extract only the archive
  members that resolve undefined symbols
- Returns the resolved MemoryBuffers and symbol table; the symbol table
  is consumed by clang-nvlink-wrapper's LTO resolution pass

clang-sycl-linker gains -l, --whole-archive/--no-whole-archive, and -u
options (added to SYCLLinkOpts.td). The previous --bc-library option
has been removed in favor of the standard -l mechanism.


    [11 lines not shown]
DeltaFile
+301-0llvm/lib/Frontend/Offloading/ArchiveLinker.cpp
+35-246clang/tools/clang-nvlink-wrapper/ClangNVLinkWrapper.cpp
+67-110clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+114-6clang/test/OffloadTools/clang-sycl-linker/link.ll
+116-0llvm/include/llvm/Frontend/Offloading/ArchiveLinker.h
+72-32clang/test/OffloadTools/clang-sycl-linker/basic.ll
+705-3946 files not shown
+804-40612 files

LLVM/project 1dae5decompiler-rt/test/sanitizer_common/TestCases/Linux signal_line.cpp

[compiler-rt] Add missing cstdlib include to signal_line.cpp test (#201955)

Fixes test after libc++ PR #195509 which drops transitive includes.
DeltaFile
+1-0compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
+1-01 files

LLVM/project 488875cllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 bt-merge-fuse.ll

[X86] Fix crash on BT bit index narrower than log2(BW) (#201793)

peekThroughBitPosExtTrunc asserted that peeling
TRUNCATE/ZERO_EXTEND/ANY_EXTEND never drops below log2(BW) bits, but a
BT bit index can be e.g. a zext of i1. Stop peeking there instead: below
log2(BW) bits a peeled value no longer determines the bit index on its
own, so comparing peeled values would also be unsound.

Fixes #201444.
DeltaFile
+28-0llvm/test/CodeGen/X86/bt-merge-fuse.ll
+8-7llvm/lib/Target/X86/X86ISelLowering.cpp
+36-72 files

LLVM/project de7a520clang/test/CodeGen/LoongArch/lasx builtin-alias.c builtin.c, lldb/source/Utility RISCV_DWARF_Registers.h

Merge branch 'users/rnk/llvm-md-1a' into users/rnk/llvm-md-1b

# Conflicts:
#       llvm/docs/GettingInvolved.md
#       llvm/docs/ProgrammersManual.md
#       llvm/docs/index.md
DeltaFile
+3,563-3,543llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+6,598-111llvm/test/CodeGen/X86/clmul-vector.ll
+2,749-2,749clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+2,745-2,745clang/test/CodeGen/LoongArch/lasx/builtin.c
+3,092-2,392llvm/test/CodeGen/AMDGPU/GlobalISel/frem.ll
+4,489-13lldb/source/Utility/RISCV_DWARF_Registers.h
+23,236-11,5532,403 files not shown
+137,246-79,0572,409 files

LLVM/project b9a0094clang/test/CodeGen/LoongArch/lasx builtin-alias.c builtin.c, lldb/source/Utility RISCV_DWARF_Registers.h

Merge branch 'main' into users/rnk/llvm-md-1a
DeltaFile
+3,563-3,543llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+6,598-111llvm/test/CodeGen/X86/clmul-vector.ll
+2,749-2,749clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+2,745-2,745clang/test/CodeGen/LoongArch/lasx/builtin.c
+3,092-2,392llvm/test/CodeGen/AMDGPU/GlobalISel/frem.ll
+4,489-13lldb/source/Utility/RISCV_DWARF_Registers.h
+23,236-11,5532,403 files not shown
+137,247-79,0572,409 files

LLVM/project cab8d8cllvm/docs Coroutines.md CommandLine.md

[docs] Migrate 20 LLVM docs to markdown (#201465)

An LLM assisted in the rewrite. I didn't use pandoc or any other tools,
and I think there are fewer artifacts. I validated these docs by opening
all 20 HTML files in my browser.

Files:
- DebuggingLLVM.md
- FAQ.md
- CompilerWriterInfo.md
- GettingStartedVS.md
- NewPassManager.md
- MemorySSA.md
- LoopTerminology.md
- Lexicon.md
- MIRLangRef.md
- CoverageMappingFormat.md
- InstrProfileFormat.md
- BitCodeFormat.md

    [9 lines not shown]
DeltaFile
+1,025-1,160llvm/docs/Coroutines.md
+890-932llvm/docs/CommandLine.md
+505-585llvm/docs/BitCodeFormat.md
+440-520llvm/docs/MIRLangRef.md
+452-489llvm/docs/Extensions.md
+422-452llvm/docs/LibFuzzer.md
+3,734-4,13814 files not shown
+6,467-7,16120 files

LLVM/project 638f3aellvm/docs Coroutines.md Coroutines.rst

[docs] Rename 20 key LLVM docs to Markdown (#201464)

This may break the docs build temporarily, but there will be a follow-up
PR that fixes it immediately after. The rename is being committed first
to aid review and source code archaelogy.

Tracking issue: #201242
DeltaFile
+2,304-0llvm/docs/Coroutines.md
+0-2,304llvm/docs/Coroutines.rst
+0-1,753llvm/docs/CommandLine.rst
+1,753-0llvm/docs/CommandLine.md
+1,362-0llvm/docs/BitCodeFormat.md
+0-1,362llvm/docs/BitCodeFormat.rst
+5,419-5,41951 files not shown
+15,568-15,56857 files

LLVM/project ba7b74fllvm/lib/Target/X86/GISel X86LegalizerInfo.cpp, llvm/test/CodeGen/X86/GlobalISel legalize-undef-vec-scaling.mir

[X86][GlobalISel] Adding missing Query to G_BUILD_VECTOR legalization (#199435)

Once G_BUILD_VECTOR was fixed, legalize-undef-vec-scaling.mir falled
into endless legalization loop as incoming MIR doesn't match correct
lowering of the type.
DeltaFile
+20-27llvm/test/CodeGen/X86/GlobalISel/legalize-undef-vec-scaling.mir
+2-1llvm/lib/Target/X86/GISel/X86LegalizerInfo.cpp
+22-282 files

LLVM/project 46bc562clang/test/CodeGen/LoongArch/lasx builtin-alias.c builtin.c, lldb/source/Plugins/Process/Utility lldb-riscv-register-enums.h RegisterInfos_riscv32.h

Merge branch 'users/rnk/llvm-md-2a' into users/rnk/llvm-md-2b
DeltaFile
+3,563-3,543llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+2,749-2,749clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+2,745-2,745clang/test/CodeGen/LoongArch/lasx/builtin.c
+4,489-13lldb/source/Utility/RISCV_DWARF_Registers.h
+4,473-0lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h
+4,253-32lldb/source/Plugins/Process/Utility/RegisterInfos_riscv32.h
+22,272-9,0821,474 files not shown
+77,494-39,5321,480 files

LLVM/project fe560c5clang/test/CodeGen/LoongArch/lasx builtin-alias.c builtin.c, lldb/source/Plugins/Process/Utility lldb-riscv-register-enums.h RegisterInfos_riscv32.h

Merge branch 'main' into users/rnk/llvm-md-2a
DeltaFile
+3,563-3,543llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+2,749-2,749clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+2,745-2,745clang/test/CodeGen/LoongArch/lasx/builtin.c
+4,489-13lldb/source/Utility/RISCV_DWARF_Registers.h
+4,473-0lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h
+4,253-32lldb/source/Plugins/Process/Utility/RegisterInfos_riscv32.h
+22,272-9,0821,474 files not shown
+77,494-39,5321,480 files

LLVM/project 34555beclang/lib/ScalableStaticAnalysisFramework/Analyses SSAFAnalysesCommon.h, clang/lib/ScalableStaticAnalysisFramework/Analyses/PointerFlow PointerFlowExtractor.cpp

[SSAF][Extractor] Make hard errors in Extractors quiet

Hard errors were used in extractors during development to quickly
identify unsupported language constructs. This commit converts them to
DEBUG_WITH_TYPE so that these errors are silenced in release builds.

rdar://178747892
DeltaFile
+31-0clang/unittests/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowTest.cpp
+25-0clang/unittests/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageTest.cpp
+10-11clang/lib/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageExtractor.cpp
+10-9clang/lib/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowExtractor.cpp
+9-0clang/lib/ScalableStaticAnalysisFramework/Analyses/SSAFAnalysesCommon.h
+85-205 files

LLVM/project 4f73c81clang/include/clang/Basic FileManager.h, clang/include/clang/Lex HeaderSearch.h

[clang][lex] Store `HeaderFileInfo` in a `MapVector` (#201936)

This is a re-commit of PR #200968 (f357a47) that was reverted by PR
#201702 (adaa9e0). One call-site of
`HeaderSearch::forEachExistingLocalFileInfo()` in `ASTWriter` relies on
stable order, which the `DenseMap` didn't provide. This PR switches to
`MapVector`, which has the same performance characteristics as the
original solution at the cost of a theoretical memory usage increase.

Original PR description:

Calling `FileManager::GetUniqueIDMapping()` during modular builds gets
very expensive if the `FileManager` has seen lots of files. This
function is used in two places in the `ASTWriter` to look up
`HeaderFileInfo` in `HeaderSearch`.

This PR changes the storage of `HeaderFileInfo` from
`FileEntry::getUID()`-indexed `std::vector<T>` to
`llvm::DenseMap<FileEntryRef, T>`, improving scanning performance by
~2.5%.
DeltaFile
+37-60clang/lib/Serialization/ASTWriter.cpp
+11-22clang/lib/Lex/HeaderSearch.cpp
+0-18clang/lib/Basic/FileManager.cpp
+17-0llvm/include/llvm/ADT/MapVector.h
+7-8clang/include/clang/Lex/HeaderSearch.h
+0-5clang/include/clang/Basic/FileManager.h
+72-1136 files

LLVM/project 80ad296llvm/lib/IR Verifier.cpp, llvm/lib/Transforms/Utils InlineFunction.cpp

Reland "Remove the optional bitcast between a musttail call and its ret" (#201280) (#201642)

This relands #201280, which was reverted in #201479 because it broke the
sanitizer buildbot

The revert was caused by a heap-use-after-free in
`BitcodeReader::materialize`

Fix: The CallBase branch could have erased I before we read it in the
new conditional
DeltaFile
+9-34llvm/lib/IR/Verifier.cpp
+32-0llvm/test/Bitcode/musttail-bitcast-upgrade.ll
+0-24llvm/test/Transforms/CallSiteSplitting/musttail.ll
+2-21llvm/lib/Transforms/Utils/InlineFunction.cpp
+0-19llvm/test/Transforms/SafeStack/X86/musttail.ll
+0-14llvm/test/Instrumentation/AddressSanitizer/musttail.ll
+43-1125 files not shown
+55-13411 files

LLVM/project 4183355flang/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
+12-0flang/lib/Lower/OpenMP/Utils.h
+838-123 files not shown
+838-399 files

LLVM/project e9a4dd0compiler-rt/test/fuzzer OutOfProcessFuzzTarget.cpp

[compiler-rt] Add stdlib include to OutOfProcessFuzzTarget.cpp (#201944)

Fixes test after libc++ PR #195509 which drops transitive includes.
DeltaFile
+1-0compiler-rt/test/fuzzer/OutOfProcessFuzzTarget.cpp
+1-01 files

LLVM/project 3b89e77compiler-rt/lib/sanitizer_common/symbolizer sanitizer_wrappers.cpp

[compiler-rt] [sanitizers] Add includes for symbolizer (#201929)

After ce5b2e876494cb95f02d9f915081e2b8781e74d1 this stopped building.
DeltaFile
+2-0compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp
+2-01 files

LLVM/project 0bb7ad1clang/include/clang/ScalableStaticAnalysisFramework/Core/Model EntityLinkage.h, clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary TUSummaryExtractor.cpp

[SSAF] Let function parameters inherit linkage from their parent functions

SSAF treats parameters as entities and may not always associate them
back to their parent functions. Therefore, it needs to identify
parameters of functions with external linkage across different
TUs. Treating them as having no linkage (as in C++) causes the same
parameter in different TUs to be assigned different EntityIDs. As a
result, the behavior of the parameter across multiple TUs cannot be
correlated.

rdar://178844032
DeltaFile
+63-0clang/test/Analysis/Scalable/PointerFlow/external-inline-function-in-multi-tu.test
+42-0clang/unittests/ScalableStaticAnalysisFramework/TUSummaryBuilderTest.cpp
+18-0clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary/TUSummaryExtractor.cpp
+4-2clang/include/clang/ScalableStaticAnalysisFramework/Core/Model/EntityLinkage.h
+127-24 files

LLVM/project de59f9ellvm/include/llvm/BinaryFormat DXContainer.h, llvm/include/llvm/ObjectYAML DXContainerYAML.h

[DirectX][ObjectYAML] Add SRCI part support (#199446)

Add support for DXContainer SRCI in the ObjectYAML pipeline so it can be
represented in structured YAML and round-tripped through
yaml2obj/obj2yaml.

SRCI is emitted into shader PDB files. It stores shader source code that
is displayed in PIX, and shader compilation flags.
DeltaFile
+324-4llvm/lib/Object/DXContainer.cpp
+243-0llvm/lib/MC/DXContainerInfo.cpp
+213-0llvm/unittests/Object/DXContainerTest.cpp
+185-0llvm/include/llvm/BinaryFormat/DXContainer.h
+179-0llvm/lib/ObjectYAML/DXContainerYAML.cpp
+151-0llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+1,295-414 files not shown
+2,627-520 files

LLVM/project 3590131mlir/include/mlir/Dialect/SPIRV/IR SPIRVCLOps.td, mlir/test/Dialect/SPIRV/IR ocl-ops.mlir

[mlir][SPIR-V] Add OpenCL cbrt op (#201914)
DeltaFile
+21-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCLOps.td
+16-0mlir/test/Dialect/SPIRV/IR/ocl-ops.mlir
+2-0mlir/test/Target/SPIRV/ocl-ops.mlir
+39-03 files

LLVM/project afa1a62flang/lib/Lower/OpenMP Utils.cpp ClauseProcessor.cpp

[flang][OpenMP][NFC] Share declare mapper helpers for iterator modifier lowering

Move mapper lookup and implicit default mapper creation into reusable
OpenMP lowering helpers so regular map lowering and iterator-generated
map entries can use the same resolution path.

This prepares Flang iterator modifier lowering for map and motion clauses
without changing the generated IR for existing non-iterator maps.
DeltaFile
+153-0flang/lib/Lower/OpenMP/Utils.cpp
+6-142flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+7-0flang/lib/Lower/OpenMP/Utils.h
+166-1423 files

LLVM/project 2c3b350flang/lib/Lower/OpenMP Utils.h

Add doxygen documentation to resolveMapperId
DeltaFile
+18-0flang/lib/Lower/OpenMP/Utils.h
+18-01 files

LLVM/project d2dc471llvm/lib/Target/AMDGPU AMDGPUBarrierLatency.cpp, llvm/test/CodeGen/AMDGPU ldsdmacnt_sched.mir

[AMDGPU] Do not always add latency between LDSDMA -> S_WAIT_LDSDMA

Change-Id: Ibeee5f7bfdeab730ebbc5a1724b716ca2ce0d335
DeltaFile
+351-0llvm/test/CodeGen/AMDGPU/ldsdmacnt_sched.mir
+74-0llvm/lib/Target/AMDGPU/AMDGPUBarrierLatency.cpp
+425-02 files

LLVM/project 276cc2fllvm/lib/Target/DirectX/DXILWriter DXILBitcodeWriter.cpp, llvm/lib/Target/DirectX/DirectXIRPasses DXILDebugInfo.cpp

[DirectX] Rewrite DIGlobalVariableExpression to DXDIGlobalVariable (#199791)

DIGlobalVariable used to have an `expr` operand. Starting from
bceaaa964360 `expr` is now an operand of DIGlobalVariableExpression,
which references both the variable and the expression.

Before:
    !0 = !DIGlobalVariable(expr: !1)
    !1 = !DIExpression(DW_OP_plus, 4)

Now:
    !2 = !DIGlobalVariableExpression(var: !3, expr: !4)
!3 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false,
isDefinition: true, type: !6)
    !4 = !DIExpression(DW_OP_plus, 4)

DXIL does not support DIGlobalVariableExpression, so we have to fold
`expr` back to DIGlobalVariable.


    [2 lines not shown]
DeltaFile
+39-0llvm/test/CodeGen/DirectX/DebugInfo/di-globalvariable.ll
+36-0llvm/test/tools/dxil-dis/di-globalvariable.ll
+17-0llvm/lib/Target/DirectX/DirectXIRPasses/DXILDebugInfo.cpp
+1-1llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
+93-14 files