LLVM/project 6d49460clang/lib/Driver/ToolChains MinGW.cpp, clang/test/Driver mingw.cpp

[Clang] [MinGW] Handle `-nolibc` argument (#182062)

This implementation differs from GCC, but arguably more in line with
Unix systems, because it stops linking of default Win32 system
libraries.

On GCC it works like this:
```
❯ /ucrt64/bin/gcc -### /dev/null -nolibc 2>&1 | tr ' ' '\n' | rg '^\-l' | sort -u
-lgcc
-lgcc_eh
-lkernel32
-lmingw32
-lmingwex
-lmsvcrt

❯ /ucrt64/bin/gcc -### /dev/null 2>&1 | tr ' ' '\n' | rg '^\-l' | sort -u
-ladvapi32
-lgcc

    [21 lines not shown]
DeltaFile
+21-16clang/lib/Driver/ToolChains/MinGW.cpp
+10-0clang/test/Driver/mingw.cpp
+31-162 files

LLVM/project 16f02c0clang/test/CodeGen/X86 pr190962.ll, llvm/lib/Target/X86 X86InstrInfo.cpp X86InstrInfo.h

[X86][APX] Add copy instruction to LiveInterval of SrcReg (#191102)

Fixes: #190962
DeltaFile
+64-0clang/test/CodeGen/X86/pr190962.ll
+19-8llvm/lib/Target/X86/X86InstrInfo.cpp
+2-1llvm/lib/Target/X86/X86InstrInfo.h
+1-1llvm/lib/Target/X86/X86FastISel.cpp
+86-104 files

LLVM/project 5013640orc-rt/include/orc-rt Session.h

[orc-rt] Add comment about Session::waitForShutdown usage. NFC. (#191111)

Add a warning not to call Session::waitFromShutdown from on-detach or
on-shutdown handlers.
DeltaFile
+6-0orc-rt/include/orc-rt/Session.h
+6-01 files

LLVM/project b55965cclang/test/Driver modules-driver-dep-graph.cpp

clang/test: Prepend a cleanup triggered by #190062 (#191103)
DeltaFile
+1-0clang/test/Driver/modules-driver-dep-graph.cpp
+1-01 files

LLVM/project e8ef537llvm/lib/Transforms/Scalar NaryReassociate.cpp

review: address suggestions
DeltaFile
+21-29llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+21-291 files

LLVM/project 57d241bllvm/lib/Transforms/Scalar NaryReassociate.cpp

delay fetching unifromity for target which don't need it
DeltaFile
+10-7llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+10-71 files

LLVM/project 2a3af39llvm/include/llvm/Transforms/Scalar NaryReassociate.h, llvm/lib/Transforms/Scalar NaryReassociate.cpp

[NaryReassociate] Make uniformity-aware to prefer grouping uniform values
DeltaFile
+96-3llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+5-5llvm/test/Transforms/NaryReassociate/AMDGPU/nary-add-uniform.ll
+6-3llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
+3-1llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
+110-124 files

LLVM/project e730e78llvm/test/Transforms/NaryReassociate/AMDGPU nary-add-uniform.ll

[NaryReassociate][AMDGPU] Pre-commit test for uniformity-aware reassociation (NFC)
DeltaFile
+319-0llvm/test/Transforms/NaryReassociate/AMDGPU/nary-add-uniform.ll
+319-01 files

LLVM/project f8edfd4llvm/lib/Target/AMDGPU AMDGPUSwLowerLDS.cpp, llvm/test/CodeGen/AMDGPU amdgpu-sw-lower-lds-static-alloca-placement.ll

splice and then move stragglers allocas
DeltaFile
+40-74llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-alloca-placement.ll
+9-6llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp
+49-802 files

LLVM/project 4292511llvm/include/llvm/ADT GenericUniformityImpl.h, llvm/lib/Analysis UniformityAnalysis.cpp

Skip CycleAnalysis on targets without branch divergence
DeltaFile
+13-12llvm/lib/Analysis/UniformityAnalysis.cpp
+14-0llvm/include/llvm/ADT/GenericUniformityImpl.h
+27-122 files

LLVM/project 6837e7allvm/include/llvm/ADT GenericUniformityImpl.h

review: address suggestion
DeltaFile
+4-12llvm/include/llvm/ADT/GenericUniformityImpl.h
+4-121 files

LLVM/project ec78b21orc-rt/unittests SessionTest.cpp

[orc-rt] Add ScheduleShutdownFromOnDetachHandler unit test. (#191110)

This test checks that it's safe to call Session::shutdown from an
on-detach handler, and that:
1. The Session does proceed to shut down.
2. All on-detach handlers run before any on-shutdown handlers.
DeltaFile
+24-0orc-rt/unittests/SessionTest.cpp
+24-01 files

LLVM/project b48f5afllvm/lib/DebugInfo/LogicalView/Readers LVDWARFReader.cpp LVCodeViewReader.cpp, llvm/unittests/DebugInfo/LogicalView DWARFReaderTest.cpp

Revert "Fix missed 'else'  in LVCodeViewReader and LVDWARFReader.cpp. " (#191109)

Reverts llvm/llvm-project#188578

It cause a test failure on multiple buildbots.
DeltaFile
+1-75llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
+5-3llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
+5-3llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp
+11-813 files

LLVM/project 3cc34fbcompiler-rt/cmake/caches hexagon-linux-clangrt.cmake

[compiler-rt] Enable sanitizers, XRay, etc for hexagon (#190300)

Enable additional compiler-rt components in the hexagon-linux-clangrt
standalone cache file.

Also set CAN_TARGET_hexagon=1 to bypass the try_compile() probe that
fails during cross-compilation, and configure SANITIZER_CXX_ABI to use
the in-tree libc++ to avoid link failures.
DeltaFile
+12-7compiler-rt/cmake/caches/hexagon-linux-clangrt.cmake
+12-71 files

LLVM/project 82aee4cllvm/lib/DebugInfo/LogicalView/Readers LVCodeViewReader.cpp LVDWARFReader.cpp, llvm/unittests/DebugInfo/LogicalView DWARFReaderTest.cpp

[llvm-debuginfo-analyzer] Fix missed 'else'  in LVCodeViewReader and LVDWARFReader.cpp.  (#188578)

Issues found PVS studio static analyzer. LVCodeViewReader.cpp. PR for #170117.

4. Potent UB: manipulation of invalid object.
The PVS-Studio warning: V519 The 'FeaturesValue' variable is assigned values twice successively.

Committed on behalf of @Seraphimt
DeltaFile
+75-1llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
+3-5llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp
+3-5llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
+81-113 files

LLVM/project b57e6fcllvm/lib/Target/AMDGPU SIMachineFunctionInfo.cpp

[NFC][AMDGPU] Fix a compiler warning caused by a small typo
DeltaFile
+2-2llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+2-21 files

LLVM/project edff73ellvm/include/llvm/ABI FunctionInfo.h

[LLVMABI] Fix build for GCC < 8 (#190974)

`llvm::abi::ArgInfo::get*` functions return `llvm::abi::ArgInfo` by
value, so we need the type to be copyable. It is not though, because of
the non trivially copyable member `MaybeAlign` (`std::optional<Align>`)
in a union, which deletes the implicit copy/move constructors and
assignment operators.
For modern GCC versions and for clang this does not present as a problem
due to named return value optimization (NRVO). It is however not a bug
in old GCC versions, because NRVO is not guaranteed. Similary
`std::optional`
could be trivially copyable, but that is also not guaranteed by the
standard.

Instead of depending on these details of the C++ implementation, move
the `MaybeAlign` member out of the union, and make it a separate member
of `abi::ArgInfo`. We lose the expressiveness from the type system that
`IndirectAttrInfo` always has a defined alignment, but we can get that
back in practice by placing asserts in the code that uses it. Therefore

    [2 lines not shown]
DeltaFile
+14-7llvm/include/llvm/ABI/FunctionInfo.h
+14-71 files

LLVM/project 6d66e5eclang/test/Driver modules-driver-dep-graph.cpp

test: Prepend a cleanup triggered by #190062
DeltaFile
+1-0clang/test/Driver/modules-driver-dep-graph.cpp
+1-01 files

LLVM/project 0302140llvm/lib/Target/AMDGPU AMDGPURewriteAGPRCopyMFMA.cpp

Removed unnecessary counter, instead used the existing statistic.
DeltaFile
+2-7llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
+2-71 files

LLVM/project 3b9f791compiler-rt/lib/lsan lsan_common.cpp

[LSAN] Add extra suppressions on Apple Aarch64 (#117478)

- _fetchInitializingClassList for startup code in dyld.
- dyld4::RuntimeState::_instantiateTLVs for thread locals.

Fixes https://github.com/llvm/llvm-project/issues/115992, now it shows
the following instead (in a project using thread locals):
```
-----------------------------------------------------
Suppressions used:
  count      bytes template
      3        120 *_fetchInitializingClassList*
      1        104 *dyld4::RuntimeState::_instantiateTLVs*
-----------------------------------------------------
```
DeltaFile
+7-0compiler-rt/lib/lsan/lsan_common.cpp
+7-01 files

LLVM/project 42629d7llvm/lib/Target/AArch64 AArch64InstrInfo.td, llvm/test/CodeGen/AArch64 logical-op-with-not.ll atomicrmw-O0.ll

[AArch64][CodeGen] match (or x (not y)) to generate mov+orn (#190769)

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

Adds AddedComplexity to increase the priority the pattern that matches
(or x (not y)) and generates a mov+orn instead of the original mvn+orr.

The number of instructions still stay the same but mov+orn can be
considered better than mvn+orr for two reasons:
1. Symmetry: For the same input with an 'and' instead of 'or', mov+bic
is generated.
2. Optimzation through register rename: If mov is immediate (for
example, 'mov x1, #0x4'), it can be retired early by the register
renamer and never issued for execution.
DeltaFile
+32-8llvm/test/CodeGen/AArch64/logical-op-with-not.ll
+12-12llvm/test/CodeGen/AArch64/atomicrmw-O0.ll
+4-0llvm/lib/Target/AArch64/AArch64InstrInfo.td
+2-2llvm/test/CodeGen/AArch64/arm64-atomic.ll
+50-224 files

LLVM/project dabd8cccompiler-rt/lib/sanitizer_common sanitizer_platform_limits_posix.cpp

[compiler-rt] fix __sanitizer::struct_sock_fprog_sz availability (#183411)

`struct sock_fprog` is not provided by glibc, but rather by the linux
headers (`#include <linux/filter.h`). It seems that glibc due to an
implementation detail internally includes `<linux/filter.h>` somewhere
other C libs (e.g. musl) do not, which previously caused build failures
and let to disabling `struct sock_fprog` on non-glibc Linux systems.

This adds the missing include and provides it again for all Linux
systems regardless of C lib.
DeltaFile
+2-1compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+2-11 files

LLVM/project fc48faccompiler-rt/lib/sanitizer_common sanitizer_linux_libcdep.cpp

[TSan] Fix determining static TLS blocks (#183106)

Running gcc test c-c++-common/tsan/tls_race.c on s390 we get:

ThreadSanitizer: CHECK failed: tsan_platform_linux.cpp:618 "((thr_beg))
>= ((tls_addr))" (0x3ffaa35e140, 0x3ffaa35e250) (tid=2419930)
#0 __tsan::CheckUnwind() /devel/src/libsanitizer/tsan/tsan_rtl.cpp:696
(libtsan.so.2+0x91b57)
#1 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long
long, unsigned long long)
/devel/src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:86
(libtsan.so.2+0xd211b)
#2 __tsan::ImitateTlsWrite(__tsan::ThreadState*, unsigned long, unsigned
long) /devel/src/libsanitizer/tsan/tsan_platform_linux.cpp:618
(libtsan.so.2+0x8faa3)
#3 __tsan::ThreadStart(__tsan::ThreadState*, unsigned int, unsigned long
long, __sanitizer::ThreadType)
/devel/src/libsanitizer/tsan/tsan_rtl_thread.cpp:225
(libtsan.so.2+0xaadb5)

    [30 lines not shown]
DeltaFile
+2-2compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+2-21 files

LLVM/project e65dd1fllvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV musttail.ll

[RISCV][NFC] Improve Musttail Comments/Tests (#191093)

In the Target code, this is mostly fixing typos or other comment issues.

In the musttail.ll test, this ensures the tests are more aligned with
their comments, and that the comments are accurate. I inserted some
inline asm clobbers so it's also easier to see what's going on.
DeltaFile
+61-37llvm/test/CodeGen/RISCV/musttail.ll
+4-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+65-392 files

LLVM/project d0a5449clang/include/clang/ScalableStaticAnalysisFramework/Core/Serialization SerializationFormat.h, clang/lib/ScalableStaticAnalysisFramework/Core/Serialization/JSONFormat WPASuite.cpp

[clang][ssaf] Add `JSONFormat` support for `WPASuite` (#191082)

This patch adds `JSONFormat` serialization support for `WPASuite`.

- Adds `readWPASuite` / `writeWPASuite` to the `SerializationFormat`
abstract interface and implements them in `JSONFormat`.
- Introduces `AnalysisResultRegistryGenerator`, a per-format plugin
registry template in `SerializationFormat`, allowing analysis authors to
register (de)serializers for their `AnalysisResult` subtypes with a
single static declaration.
- Extends `PrivateFieldNames.def` with `WPASuite::Data` and
`WPASuite::IdTable`, and adds a `makeWPASuite()` factory to
`SerializationFormat`, so deserialization code can construct a
`WPASuite` incrementally through the same access-controlled pattern used
for all other SSAF data structures.
DeltaFile
+212-0clang/lib/ScalableStaticAnalysisFramework/Core/Serialization/JSONFormat/WPASuite.cpp
+197-0clang/lib/ScalableStaticAnalysisFramework/Plugins/ExamplePlugin/PairsAnalysis.cpp
+160-0clang/lib/ScalableStaticAnalysisFramework/Plugins/ExamplePlugin/TagsAnalysis.cpp
+136-0clang/lib/ScalableStaticAnalysisFramework/Plugins/ExamplePlugin/TagsPairsAnalysis.cpp
+134-0clang/include/clang/ScalableStaticAnalysisFramework/Core/Serialization/SerializationFormat.h
+132-0clang/test/Analysis/Scalable/ssaf-format/WPASuite/with-plugin.test
+971-041 files not shown
+1,683-447 files

LLVM/project 8ce74e7llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/ARM funnel-shift.ll

[TargetLowering] Add support for more constants to expandDIVREMByConstant. (#189286)

If we can find a chunk size k where 2^k mod divisor == -1, we can add
the even chunks and subtract the odd chunks. The resulting sum may be
negative, so we need to add 2^k + 1 (a multiple of divisor) for each odd
chunk to ensure the result is positive. We have enough extra bits
between the chunk size and HBitWidth to avoid overflow.

The idea here is similar to checking if a decimal number is divisible by
11. You can add the even digits and subtract the odd digits. If the
resulting sum is divisible by 11 the original number is divisible by 11.
DeltaFile
+191-186llvm/test/CodeGen/Mips/funnel-shift.ll
+130-178llvm/test/CodeGen/PowerPC/funnel-shift.ll
+156-116llvm/test/CodeGen/ARM/funnel-shift.ll
+64-37llvm/test/CodeGen/X86/funnel-shift.ll
+47-17llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+32-5llvm/test/CodeGen/X86/i128-udiv.ll
+620-5396 files

LLVM/project 0c36771llvm/lib/Target/RISCV RISCVInstrInfoZicbo.td

[RISCV] Remove NoVendorXMIPSCBOP from the Zicbop instructions. (#191015)

The XMIPSCBOP encodings use OP-CUSTOM-0 so there's no encoding overlap
here. Presence of a vendor extension should not disable parsing or
disassembly of a standard extension that doesn't overlap.
DeltaFile
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoZicbo.td
+2-21 files

LLVM/project 53e0c2butils/bazel/llvm-project-overlay/mlir BUILD.bazel

[bazel] Rename PYBIND11 variables (#191095)

These are still used with nanobind so this name was misleading
DeltaFile
+23-24utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+23-241 files

LLVM/project f736537clang/test/SemaHIP incorrect-atomic-scope.hip, clang/test/SemaOpenCL incorrect-atomic-scope.cl

[Clang][NFC] tests showcasing incorrect use of HIP and OpenCL memory scope macros (#188890)

The tests demonstrate how incorrect LLVM IR is generated without
diagnostics, when an OpenCL or HIP scope number is passed to an AMDGPU
intrinsic. #185408 lays the groundwork for properly diagnosing this
situation by internally using a separate enum type to represent each set
of scope numbers.
DeltaFile
+35-0clang/test/SemaOpenCL/incorrect-atomic-scope.cl
+31-0clang/test/SemaHIP/incorrect-atomic-scope.hip
+66-02 files

LLVM/project c981328llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV basic-strided-stores.ll

[SLP] Create SLP trees starting from constant stride stores (#185964)

Must use `-slp-enable-strided-stores` to enable.
DeltaFile
+193-60llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+27-223llvm/test/Transforms/SLPVectorizer/RISCV/basic-strided-stores.ll
+220-2832 files