LLVM/project 136c9daclang/lib/CIR/CodeGen CIRGenCXX.cpp, clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

[CIR] Implement global array dtor support (#169070)

This implements handling to destroy global arrays that require
destruction. Unlike classic codegen, CIR emits the destructor loop into
a 'dtor' region associated with the global array variable. Later, during
LoweringPrepare, this code is moved into a helper function and a call to
__cxa_atexit arranges for it to be called during the shared object
shutdown.
DeltaFile
+111-12clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+101-5clang/test/CIR/CodeGen/global-init.cpp
+19-7clang/lib/CIR/CodeGen/CIRGenCXX.cpp
+231-243 files

LLVM/project 677fbf8clang/test/CIR/CodeGen/X86 avx512f-builtins.c avx-builtins.c

[CIR] Upstream CIR codegen for undef x86 builtins (#167945)

DeltaFile
+79-0clang/test/CIR/CodeGen/X86/avx512f-builtins.c
+76-0clang/test/CIR/CodeGen/X86/avx-builtins.c
+66-0clang/test/CIR/CodeGen/X86/avx512fp16-builtins.c
+47-0clang/test/CIR/CodeGen/X86/avx10_2bf16-builtins.c
+37-0clang/test/CIR/CodeGen/X86/sse2-builtins.c
+28-0clang/test/CIR/CodeGen/X86/avx10_2_512bf16-builtins.c
+333-02 files not shown
+356-48 files

LLVM/project 7e6c913lldb/unittests/Editline EditlineTest.cpp

[lldb] Fix EditlineTest closing files multiple times. (#169100)

This updates the EditlineTest to use `lldb::FileSP` to ensure the
associated FDs are only closed a single time.

Currently, there is some confusion between the `FilePointer`,
`PseudoTerminal` and `LockableStreamFile` about when the files are
closed resulting in a crash in some due to a `fflush` on a closed file.
DeltaFile
+28-58lldb/unittests/Editline/EditlineTest.cpp
+28-581 files

LLVM/project 9fa7627llvm/include/llvm/CodeGen SDPatternMatch.h, llvm/unittests/CodeGen SelectionDAGPatternMatchTest.cpp

DAG: Handle poison in m_Undef (#168288)

DeltaFile
+3-1llvm/include/llvm/CodeGen/SDPatternMatch.h
+2-0llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
+5-12 files

LLVM/project d7307f4compiler-rt/test/orc/TestCases/Darwin/x86-64 objc-imageinfo.S

[ORC] Fix obj-imageinfo.S on X86 Darwin with Internal Shell (#169104)

d464c99f595b69d3a34b361b6a935e803c60d308 fixes this test on AArch64
Darwin, but I did not realize that there was another X86 version of the
test. This patch also updates the X86 version of the test in a similar
manner.
DeltaFile
+3-1compiler-rt/test/orc/TestCases/Darwin/x86-64/objc-imageinfo.S
+3-11 files

LLVM/project bf6e3f1clang-tools-extra/include-cleaner/test lit.cfg.py

[include-cleaner] Use lit internal shell by default for tests (#169092)

All of the tests seem to be compatible with the internal shell and the
internal shell is typically faster by 10-15% on top of providing a
better debugging experience.
DeltaFile
+14-1clang-tools-extra/include-cleaner/test/lit.cfg.py
+14-11 files

LLVM/project 9c35da1llvm/include/llvm/MC MCSymbolGOFF.h, llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp

Remove LDAttr/ERAttr and initAttributes.
DeltaFile
+25-21llvm/lib/MC/MCSymbolGOFF.cpp
+6-24llvm/include/llvm/MC/MCSymbolGOFF.h
+13-12llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp
+0-9llvm/lib/MC/MCGOFFStreamer.cpp
+4-3llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+48-695 files

LLVM/project 3d5191fllvm/unittests/Support SignalsTest.cpp

[test][Support] Disable SignalsTest.PrintsSymbolizerMarkup (#168974)

This test checks that DSOMarkupPrinter::printDSOMarkup prints the module
and segment mappings, but that is only done if we can determine the GNU
build ID for the given object, and in many environments that is not
enabled by default (e.g. the FreeBSD Clang driver never enables it, and
various other Clang drivers only do so when ENABLE_LINKER_BUILD_ID is
opted into at configure time). GCC tends to enable it by default, and
many distributions enable it for Clang, so this has gone unnoticed for a
while, but this test has been failing on FreeBSD since its creation.

Fixes: 22b9404f09dc ("Optionally print symbolizer markup backtraces.")
See: https://github.com/llvm/llvm-project/issues/168891
DeltaFile
+6-0llvm/unittests/Support/SignalsTest.cpp
+6-01 files

LLVM/project 3a3f129llvm/include/llvm/DebugInfo/BTF BTFParser.h, llvm/lib/DebugInfo/BTF BTFParser.cpp

[llvm] Replace `OwningArrayRef` with `std::vector` in `BTFParser`

`OwningArrayRef` requires that the size and the capacity are the same. This prevents reusing memory allocations unless the size happens to be exactly the same (which is rare enough we don't even try). Switch to `std::vector` instead so that we're not repeatedly calling `new[]` and `delete[]`.
DeltaFile
+3-2llvm/lib/DebugInfo/BTF/BTFParser.cpp
+1-1llvm/include/llvm/DebugInfo/BTF/BTFParser.h
+4-32 files

LLVM/project 01164dbclang/include/clang/AST VTableBuilder.h, llvm/include/llvm/ADT ArrayRef.h

[llvm][clang] Remove `llvm::OwningArrayRef`

`OwningArrayRef` has several problems.

The naming is strange: `ArrayRef` is specifically a non-owning view, so the name means "owning non-owning view".

It has a const-correctness bug that is inherent to the interface. `OwningArrayRef<T>` publicly derives from `MutableArrayRef<T>`. This means that the following code compiles:

```c++
void const_incorrect(llvm::OwningArrayRef<int> const a) {
        a[0] = 5;
}
```

It's surprising for a non-reference type to allow modification of its elements even when it's declared `const`. However, the problems from this inheritance (which ultimately stem from the same issue as the weird name) are even worse. The following function compiles without warning but corrupts memory when called:

```c++
void memory_corruption(llvm::OwningArrayRef<int> a) {
        a.consume_front();

    [17 lines not shown]
DeltaFile
+0-23llvm/include/llvm/ADT/ArrayRef.h
+5-5llvm/include/llvm/CodeGen/PBQP/Math.h
+0-7llvm/unittests/ADT/ArrayRefTest.cpp
+4-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+2-2llvm/include/llvm/CGData/CGDataPatchItem.h
+2-2clang/include/clang/AST/VTableBuilder.h
+13-421 files not shown
+14-457 files

LLVM/project 2fcbdc1clang/test/CodeGen sanitize-type-outlined.cpp

Really fix tysan test failing on unsupported arches (#169096)

'target' is not one of the features recognized by clang tests, and the
test doesn't require X86 backend to be built. Specify the target
explicitly instead. Remove duplicate `-fsanitize=type` as well.
DeltaFile
+2-4clang/test/CodeGen/sanitize-type-outlined.cpp
+2-41 files

LLVM/project c3bc565llvm/include/llvm/DebugInfo/BTF BTFParser.h, llvm/lib/DebugInfo/BTF BTFParser.cpp

[llvm] Replace `OwningArrayRef` with `std::vector` in `BTFParser`

`OwningArrayRef` requires that the size and the capacity are the same. This prevents reusing memory allocations unless the size happens to be exactly the same (which is rare enough we don't even try). Switch to `std::vector` instead so that we're not repeatedly calling `new[]` and `delete[]`.
DeltaFile
+3-2llvm/lib/DebugInfo/BTF/BTFParser.cpp
+1-1llvm/include/llvm/DebugInfo/BTF/BTFParser.h
+4-32 files

LLVM/project 6ed829blldb/bindings/lua lua-typemaps.swig

[lldb] Restore the old behavior in lua-typemaps.swig (#169103)

Restore the original behavior (i.e. before #167764), which uses
eOpenOptionWriteOnly, not eOpenOptionReadWrite. Fixes TestLuaAPI.py.
DeltaFile
+1-1lldb/bindings/lua/lua-typemaps.swig
+1-11 files

LLVM/project dc51cf9clang-tools-extra/clang-doc/assets class-template.mustache, clang-tools-extra/test/clang-doc namespace.cpp

[clang-doc] Add definition information to class templates
DeltaFile
+4-4clang-tools-extra/test/clang-doc/namespace.cpp
+1-0clang-tools-extra/clang-doc/assets/class-template.mustache
+5-42 files

LLVM/project 79f518fclang-tools-extra/test/clang-doc namespace.cpp

[clang-doc] Add Mustache HTML output to namespace test

This patch adds Mustache HTML tests alongside the legacy HTML backend
for namespace output. This way, we can see exactly where the output
currently differs before replacing the legacy backend.

The same thing will be done for all other tests where the legacy HTML
backend is tested.
DeltaFile
+99-0clang-tools-extra/test/clang-doc/namespace.cpp
+99-01 files

LLVM/project 86cbb36lld/COFF DriverUtils.cpp Options.td, lld/test/COFF driver.test

[lld] Add (ignored) /link flag to lld-link for compatibility with MSVC link.exe (#168364)

Various build tools may produce command lines invoking clang-cl and
lld-link which contain /link twice like so: e.g. `clang-cl.exe
sanitycheckcpp.cc /Fesanitycheckcpp.exe .... /link /link ...`

If link.exe is used, it ignores the extra `/link` and just issues a
warning, however lld-link tries to treat `/link` as a file name.

This PR adds a flag which is ignored in order to improve compatibility
with link.exe

There's some extra context including an "in-the-wild" example and
reproducer of the problem here:
https://github.com/frankier/meson_clang_win_activation

Co-authored-by: Frankie Robertson <frankie at robertson.name>
DeltaFile
+3-0lld/COFF/DriverUtils.cpp
+3-0lld/test/COFF/driver.test
+1-0lld/COFF/Options.td
+7-03 files

LLVM/project 68ba286llvm/lib/Transforms/Utils ScalarEvolutionExpander.cpp

[SCEVExp] Remove early exit, rely on InstSimplifyFolder (NFCI).

Remove the SCEV-based check refined in
https://github.com/llvm/llvm-project/pull/156910, as InstSimplifyFolder
manages to simplify the generated code to false directly as well.
DeltaFile
+0-11llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+0-111 files

LLVM/project 9a40b79compiler-rt/lib/ubsan_minimal ubsan_minimal_handlers.cpp

messed up merge

Created using spr 1.3.7
DeltaFile
+8-0compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
+8-01 files

LLVM/project 1b3d75fcompiler-rt/lib/ubsan_minimal ubsan_minimal_handlers.cpp, compiler-rt/test/ubsan_minimal/TestCases test-darwin-interface.c

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+40-9compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
+1-0compiler-rt/test/ubsan_minimal/TestCases/test-darwin-interface.c
+41-92 files

LLVM/project 778e104mlir/include/mlir/Dialect/XeGPU/IR XeGPUAttrs.td, mlir/lib/Dialect/XeGPU/Transforms XeGPUWgToSgDistribute.cpp

[MLIR] [XeGPU] Fix dropSgLayoutAndData & dropInstData in SliceAttr (#168618)

DeltaFile
+25-40mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp
+4-0mlir/include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td
+29-402 files

LLVM/project 4d97b78clang-tools-extra/clang-tidy .clang-tidy, clang-tools-extra/clang-tidy/utils ExceptionAnalyzer.cpp

[clang-tidy][NFC] Enable misc-const-correctness rule in clang-tidy codebase (#167172)

After successful `misc-const-correctness` cleanup (last patch
https://github.com/llvm/llvm-project/pull/167131), we can enable
`misc-const-correctness` rule for the whole project.

During cleanup, I didn't encounter any false positives so it's safe to
assume that we will have minimal FP in the future.
DeltaFile
+4-3clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
+1-0clang-tools-extra/clang-tidy/.clang-tidy
+5-32 files

LLVM/project a52e1afclang-tools-extra/clang-tidy/objc AssertEqualsCheck.cpp, clang/docs LibASTMatchersReference.html

[ASTMatchers] Make isExpandedFromMacro accept llvm::StringRef (#167060)

We can use non-owning `StringRef` in `MacroName` parameter to avoid
unnecessary copy because `MacroName` only used as an argument to
`internal::getExpansionLocOfMacro` which already accept `StringRef`.
DeltaFile
+3-3clang/docs/LibASTMatchersReference.html
+1-1clang/include/clang/ASTMatchers/ASTMatchers.h
+1-1clang-tools-extra/clang-tidy/objc/AssertEqualsCheck.cpp
+5-53 files

LLVM/project 427c182llvm/test/Transforms/LoopUnrollAndJam dependencies_multidims.ll

[unroll-and-jam] Document dependencies_multidims.ll and fix loop bounds (NFC) (#156578)

Add detailed comments explaining why each function should/shouldn't be
unroll-and-jammed based on memory access patterns and dependencies.

Fix loop bounds to ensure array accesses are within array bounds:
  * sub_sub_less: j starts from 1 (not 0) to ensure j-1 >= 0
  * sub_sub_less_3d: k starts from 1 (not 0) to ensure k-1 >= 0
  * sub_sub_outer_scalar: j starts from 1 (not 0) to ensure j-1 >= 0
DeltaFile
+101-17llvm/test/Transforms/LoopUnrollAndJam/dependencies_multidims.ll
+101-171 files

LLVM/project 6be7cf0mlir/include/mlir/Analysis/Presburger PresburgerSpace.h

[mlir][presburger] Fix PresburgerSpace comment (#167292)

DeltaFile
+2-2mlir/include/mlir/Analysis/Presburger/PresburgerSpace.h
+2-21 files

LLVM/project 45081fbclang-tools-extra/clang-doc/assets class-template.mustache namespace-template.mustache, clang-tools-extra/test/clang-doc mustache-index.cpp

[clang-doc] `<ul>` must be nested in `<li>` (#168972)

The HTML spec states that only `<li>` can be children of `<ul>`. Nested
`<ul>` tags in an unordered list must be children of `<li>`.
DeltaFile
+50-38clang-tools-extra/clang-doc/assets/class-template.mustache
+18-14clang-tools-extra/clang-doc/assets/namespace-template.mustache
+12-10clang-tools-extra/test/clang-doc/mustache-index.cpp
+80-623 files

LLVM/project 8e9bc38llvm/lib/Target/AMDGPU SIFrameLowering.cpp, llvm/test/CodeGen/AMDGPU whole-wave-functions.ll accvgpr-spill-scc-clobber.mir

WIP attempt to avoid MCRegAliasIterator
DeltaFile
+45-49llvm/test/CodeGen/AMDGPU/whole-wave-functions.ll
+30-13llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+12-12llvm/test/CodeGen/AMDGPU/accvgpr-spill-scc-clobber.mir
+4-4llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.error.ll
+91-784 files

LLVM/project 9624e4dllvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll gfx-callable-argument-types.ll

[AMDGPU] Implement CFI for CSR spills

Introduce new SPILL pseudos to allow CFI to be generated for only CSR
spills, and to make ISA-instruction-level accurate information.

Other targets either generate slightly incorrect information or rely on
conventions for how spills are placed within the entry block. The
approach in this change produces larger unwind tables, with the
increased size being spent on additional DW_CFA_advance_location
instructions needed to describe the unwinding accurately.

Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
DeltaFile
+3,160-888llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+1,932-1,933llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
+2,688-0llvm/test/CodeGen/AMDGPU/accvgpr-spill-scc-clobber.mir
+1,085-469llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+978-362llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+846-230llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll
+10,689-3,88286 files not shown
+16,200-6,01192 files

LLVM/project 9a56e55clang/lib/CIR/CodeGen CIRGenOpenACCClause.cpp, clang/test/CIR/CodeGenOpenACC declare-deviceptr.cpp

[OpenACC][CIR] deviceptr clause lowering for local 'declare' (#169085)

This is very similar to the 'link' that was done in the last patch,
except this works on all storage, but only on pointers. This also shows
a bit more of how the enter/exit pairs work in the test.

Implementation itself is very simple, as it is just properly handling it
in the clause handler.
DeltaFile
+108-0clang/test/CIR/CodeGenOpenACC/declare-deviceptr.cpp
+3-4clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+111-42 files

LLVM/project 955b033clang-tools-extra/clang-doc/assets class-template.mustache namespace-template.mustache, clang-tools-extra/test/clang-doc mustache-index.cpp

[clang-doc] `<ul>` must be nested in `<li>`

The HTML spec states that only `<li>` can be children of `<ul>`. Nested
`<ul>` tags in an unordered list must be children of `<li>`.
DeltaFile
+50-38clang-tools-extra/clang-doc/assets/class-template.mustache
+18-14clang-tools-extra/clang-doc/assets/namespace-template.mustache
+12-10clang-tools-extra/test/clang-doc/mustache-index.cpp
+80-623 files

LLVM/project ad9bc6allvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] remove Constraints class (#168963)

Remove the Constraints class from dependence analysis as it is now unused.
DeltaFile
+28-431llvm/lib/Analysis/DependenceAnalysis.cpp
+6-141llvm/include/llvm/Analysis/DependenceAnalysis.h
+34-5722 files