LLVM/project 21c1b78clang/lib/CodeGen/Targets AArch64.cpp, clang/test/CodeGen arm64-microsoft-arguments.cpp

fix: C++ empty record with align lead to va_list out of sync (#72197)

Fix AArch64 argument passing for C++ empty classes with large explicitly specified  alignment

reproducer: https://godbolt.org/z/qsze8fqra 
rel issue: https://github.com/llvm/llvm-project/issues/69872 
rel commit: https://github.com/llvm/llvm-project/commit/1711cc930bda8d27e87a2092bd220c18e4600c98
DeltaFile
+19-1clang/test/CodeGen/AArch64/args.cpp
+6-4clang/test/CodeGen/AArch64/struct-coerce-using-ptr.cpp
+6-3clang/lib/CodeGen/Targets/AArch64.cpp
+2-2clang/test/CodeGen/arm64-microsoft-arguments.cpp
+1-1clang/test/CodeGenCXX/arm64-darwinpcs.cpp
+1-1clang/test/CodeGenCXX/aarch64-arguments.cpp
+35-121 files not shown
+36-127 files

LLVM/project a0e222fllvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG switch_create.ll switch-transformations-no-lut.ll

[SimplifyCFG] Simplify uncond br with icmp & select (#165580)

Previously, SimplifyCFG only simplified unconditional branches when they
met a pattern (`swicth` -> `icmp` -> `br` -> `phi`) as follows:
```LLVM
   switch i8 %A, label %DEFAULT [ i8 1, label %end    i8 2, label %end ]
DEFAULT:
   %tmp = icmp eq i8 %A, 92
   br label %end
end:
   ... = phi i1 [ true, %entry ], [ %tmp, %DEFAULT ], [ true, %entry ]
```

This PR supports a new and more generic pattern (`switch` -> `icmp` ->
`select` -> `br` -> `phi` ) to simplify unconditional branches as
follows:
```LLVM
; BEFORE
case1:

    [36 lines not shown]
DeltaFile
+111-22llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+130-0llvm/test/Transforms/SimplifyCFG/switch_create.ll
+2-3llvm/test/Transforms/SimplifyCFG/switch-transformations-no-lut.ll
+2-2llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll
+245-274 files

LLVM/project ffb5831libc/include/llvm-libc-macros netinet-in-macros.h

[libc] add various macros relate to *ADDR* (#164830)

This patch adds 4 macros in the `netinet/in.h` header, as specified by
POSIX standards.
DeltaFile
+9-0libc/include/llvm-libc-macros/netinet-in-macros.h
+9-01 files

LLVM/project 3226a5fclang/lib/Headers avx512vlcdintrin.h avx512cdintrin.h

[Headers][X86] avx512cd - move constexpr to the end of the function attribute lists. NFC. (#166968)

Consistent with how we order the attributes in other headers

Makes it easier to compare constexpr/non-constexpr attribute defines
DeltaFile
+6-6clang/lib/Headers/avx512vlcdintrin.h
+2-2clang/lib/Headers/avx512cdintrin.h
+8-82 files

LLVM/project 8f2b167clang-tools-extra/docs/clang-tidy/checks/bugprone incorrect-enable-shared-from-this.rst crtp-constructor-accessibility.rst, clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines pro-bounds-avoid-unchecked-container-access.rst

[clang-tidy][NFC] Remove trailing whitespaces in documentation (#167103)

This is part of the codebase cleanup described in
[#167098](https://github.com/llvm/llvm-project/issues/167098)
DeltaFile
+26-26clang-tools-extra/docs/clang-tidy/checks/objc/nsdate-formatter.rst
+5-5clang-tools-extra/docs/clang-tidy/checks/bugprone/incorrect-enable-shared-from-this.rst
+5-5clang-tools-extra/docs/clang-tidy/checks/portability/template-virtual-member-function.rst
+4-4clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst
+4-4clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
+3-3clang-tools-extra/docs/clang-tidy/checks/bugprone/crtp-constructor-accessibility.rst
+47-4727 files not shown
+88-8833 files

LLVM/project c8ab3b7clang-tools-extra/clang-tidy ClangTidy.cpp, clang-tools-extra/clang-tidy/readability QualifiedAutoCheck.cpp

[clang-tidy][NFC] Run clang-format-22 over clang-tidy (#167122)

DeltaFile
+1-1clang-tools-extra/clang-tidy/ClangTidy.cpp
+0-1clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
+1-22 files

LLVM/project 577b519clang-tools-extra/clang-tidy/utils ExceptionAnalyzer.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Fix `bugprone-exception-escape` not diagnosing throws in argument lists (#165955)

Fixes #165766.
DeltaFile
+52-1clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
+15-11clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
+3-1clang-tools-extra/docs/ReleaseNotes.rst
+70-133 files

LLVM/project 8d950d2clang-tools-extra/clang-tidy/cppcoreguidelines ProBoundsAvoidUncheckedContainerAccessCheck.cpp ProBoundsAvoidUncheckedContainerAccess.cpp, clang-tools-extra/clang-tidy/performance UnnecessaryCopyInitializationCheck.cpp UnnecessaryCopyInitialization.cpp

[clang-tidy][NFC] Add missing "Check" suffix to filenames in clang-tidy checks (#166889)

This is part of the codebase cleanup described in
[#166753](https://github.com/llvm/llvm-project/issues/166753).
DeltaFile
+393-0clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitializationCheck.cpp
+0-393clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
+263-0clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
+0-262clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccess.cpp
+179-0clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStaticCheck.cpp
+0-178clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp
+835-83340 files not shown
+1,724-1,69446 files

LLVM/project 856e1f0llvm/include/llvm/IR PatternMatch.h, llvm/lib/Analysis InstructionSimplify.cpp

[IR] Account for byte width in m_PtrAdd

The method has few uses yet, so just pass DL argument to it. The change
follows m_PtrToIntSameSize, and I don't see a better way of delivering
the byte width to the method.
DeltaFile
+20-6llvm/unittests/IR/PatternMatch.cpp
+8-5llvm/include/llvm/IR/PatternMatch.h
+4-3llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+1-1llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+1-1llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
+1-1llvm/lib/Analysis/InstructionSimplify.cpp
+35-176 files

LLVM/project 5332872llvm/include/llvm/IR Intrinsics.td Intrinsics.h, llvm/lib/IR Intrinsics.cpp AutoUpgrade.cpp

[IR] Make @llvm.memset prototype byte width dependent

This patch changes the type of the value argument of @llvm.memset and
similar intrinsics from i8 to iN, where N is the byte width specified
in data layout string.
Note that the argument still has fixed type (not overloaded), but type
checker will complain if the type does not match the byte width.

Ideally, the type of the argument would be dependent on the address
space of the pointer argument. It is easy to do this (and I did it
downstream as a PoC), but since data layout string doesn't currently
allow different byte widths for different address spaces, I refrained
from doing it now.
DeltaFile
+36-25llvm/lib/IR/Intrinsics.cpp
+9-4llvm/include/llvm/IR/Intrinsics.td
+8-5llvm/include/llvm/IR/Intrinsics.h
+3-1llvm/lib/IR/AutoUpgrade.cpp
+2-2llvm/lib/IR/Core.cpp
+3-1llvm/lib/IR/Function.cpp
+61-387 files not shown
+71-4713 files

LLVM/project 73b1913llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine/SimplifyLibCalls memcpy-b16.ll memset-b16.ll

[SimplifyLibCalls] Add initial support for non-8-bit bytes

The patch makes CharWidth argument of `getStringLength` mandatory
and ensures the correct values are passed in most cases.
This is *not* a complete support for unusual byte widths in
SimplifyLibCalls since `getConstantStringInfo` returns false for those.
The code guarded by `getConstantStringInfo` returning true is unchanged
because the changes are currently not testable.
DeltaFile
+126-67llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+69-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/memcpy-b16.ll
+66-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/memset-b16.ll
+50-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/strcmp-b32.ll
+47-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/stpncpy-b16.ll
+45-0llvm/test/Transforms/InstCombine/SimplifyLibCalls/strchr-b16.ll
+403-6729 files not shown
+929-10135 files

LLVM/project c5eb6f7llvm/lib/Analysis ValueTracking.cpp

[ValueTracking] Make isBytewiseValue byte width agnostic

This is a simple change to show how easy it can be to support unusual
byte widths in the middle end.
DeltaFile
+16-14llvm/lib/Analysis/ValueTracking.cpp
+16-141 files

LLVM/project 0d66f01clang/lib/CodeGen/TargetBuiltins AMDGPU.cpp, llvm/lib/Analysis ValueTracking.cpp

[ValueTracking] Add CharWidth argument to getConstantStringInfo (NFC)

The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.
DeltaFile
+72-31llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+9-3llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+5-2llvm/lib/Analysis/ValueTracking.cpp
+2-2llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
+2-2clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+2-2llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
+92-424 files not shown
+96-4610 files

LLVM/project 29393ecllvm/include/llvm/IR IRBuilder.h, llvm/lib/Transforms/Instrumentation SanitizerCoverage.cpp

[IRBuilder] Add getByteTy and use it in CreatePtrAdd

The change requires DataLayout instance to be available, which, in turn,
requires insertion point to be set. In-tree tests detected only one case
when the function was called without setting an insertion point, it was
changed to create a constant expression directly.
DeltaFile
+22-0llvm/unittests/IR/IRBuilderTest.cpp
+8-2llvm/include/llvm/IR/IRBuilder.h
+2-3llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+32-53 files

LLVM/project 670e94dllvm/include/llvm/IR DataLayout.h, llvm/lib/IR DataLayout.cpp

[DataLayout] Add byte specification

This patch adds byte specification to data layout string.
The specification is `b:<size>`, where `<size>` is the size of a byte
in bits (later referred to as "byte width").

Limitations:
* The only values allowed for byte width are 8, 16, and 32.
16-bit bytes are popular, and my downstream target has 32-bit bytes.
These are the widths I'm going to add tests for in follow-up patches,
so this restriction only exists because other widths are untested.
* It is assumed that bytes are the same in all address spaces.
Supporting different byte widths in different address spaces would
require adding an address space argument to all DataLayout methods
that query ABI / preferred alignments because they return *byte*
alignments, and those will be different for different address spaces.
This is too much effort, but it can be done in the future if the need
arises, the specification reserves address space number before ':'.
DeltaFile
+67-18llvm/lib/IR/DataLayout.cpp
+16-6llvm/include/llvm/IR/DataLayout.h
+83-242 files

LLVM/project af456dfbolt/include/bolt/Core BinaryFunction.h BinaryContext.h, bolt/lib/Core BinaryContext.cpp

[BOLT] Refactor tracking internals of BinaryFunction. NFCI (#167074)

In addition to tracking offsets inside a `BinaryFunction` that are
referenced by data relocations, we need to track those relocations too.
Plus, we will need to map symbols referenced by such relocations back to
the containing function.

This change introduces `BinaryFunction::InternalRefDataRelocations` to
track the aforementioned relocations and expands
`BinaryContext::SymbolToFunctionMap` to include local/temp symbols
involved in relocation processing.

There is no functional change introduced that should affect the output.
Future PRs will use the new tracking capabilities.
DeltaFile
+28-0bolt/include/bolt/Core/BinaryFunction.h
+11-0bolt/lib/Core/BinaryContext.cpp
+4-2bolt/lib/Rewrite/RewriteInstance.cpp
+1-1bolt/include/bolt/Core/BinaryContext.h
+44-34 files

LLVM/project 7734276llvm/benchmarks CMakeLists.txt

benchmarks: Fix sample_symbol_list.txt generation again (#167078)

This wasn't triggering on a basic build
DeltaFile
+1-1llvm/benchmarks/CMakeLists.txt
+1-11 files

LLVM/project d66b4a9llvm/benchmarks CMakeLists.txt

Remove {} instead
DeltaFile
+15-17llvm/benchmarks/CMakeLists.txt
+15-171 files

LLVM/project c54d425llvm/benchmarks CMakeLists.txt

benchmarks: Fix sample_symbol_list.txt generation again

This wasn't triggering on a basic build. The various target checks
seem to not work as I expect with AND, so split this into separate
if TARGET checks.
DeltaFile
+17-15llvm/benchmarks/CMakeLists.txt
+17-151 files

LLVM/project 0875755.github/workflows premerge.yaml

[CI] Drop  use of install-ninja action (#167068)

We can just use brew directly since this step is always run on macOS
runners.
DeltaFile
+2-1.github/workflows/premerge.yaml
+2-11 files

LLVM/project 6c12623clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Fix a std::optional<bool> mishap (#167091)

This is about the value saved in the std::optional, not about whether
the optional has a value at all.
DeltaFile
+1-1clang/lib/AST/ByteCode/Compiler.cpp
+1-11 files

LLVM/project b4b57adllvm/lib/Target/AMDGPU SIFoldOperands.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.mfma.ll llvm.amdgcn.mfma.gfx90a.ll

[AMDGPU][MachineVerifier] test failures in SIFoldOperands (#166600)

After PR:https://github.com/llvm/llvm-project/pull/151421 merged
following fails in SIFoldOperands showed up.

LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll
LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll
LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.ll
LLVM :: CodeGen/AMDGPU/mfma-loop.ll
LLVM :: CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll

In Folding code, if folded operand is register ensure earlyClobber is
set.

---------

Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
Co-authored-by: Shilei Tian <i at tianshilei.me>
DeltaFile
+26-23llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.ll
+4-4llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll
+3-3llvm/test/CodeGen/AMDGPU/mfma-loop.ll
+4-0llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+1-1llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll
+1-1llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll
+39-326 files

LLVM/project de4aa9cllvm/lib/Target/AMDGPU SIPeepholeSDWA.cpp

AMDGPU: Minor SDWA pass cleanups (#166629)

Don't use low level regclass query in SDWA pass.
DeltaFile
+11-10llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+11-101 files

LLVM/project 2a3ef05llvm/unittests/ExecutionEngine/Orc LibraryResolverTest.cpp

Fix issues and re-enable tests disabled in PR #165983 (from PR #165360) (#166147)

1. Fixed test setup to correctly create .so/.dylib files in the build
directory.
Previously, the build was happening in the source directory using the
same
   input parent path.

2. Fixed architecture compatibility check in #166510 .

Co-authored-by: Vassil Vassilev <v.g.vassilev at gmail.com>
DeltaFile
+4-5llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp
+4-51 files

LLVM/project 6fac21eclang/lib/AST/ByteCode Interp.cpp Compiler.cpp, clang/test/AST/ByteCode cxx11.cpp

[clang][bytecode] Avoid copies with elidable CXXConstructExprs (#166931)

To fix the newly added cwg6.cpp.
DeltaFile
+49-31clang/lib/AST/ByteCode/Interp.cpp
+15-1clang/lib/AST/ByteCode/Compiler.cpp
+8-0clang/test/AST/ByteCode/cxx11.cpp
+3-0clang/lib/AST/ByteCode/Opcodes.td
+1-0clang/lib/AST/ByteCode/Interp.h
+1-0clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
+77-326 files

LLVM/project 05dacaellvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls xcore.ll

XCore: Add iprintf to RuntimeLibcalls system library
DeltaFile
+6-0llvm/test/Transforms/Util/DeclareRuntimeLibcalls/xcore.ll
+1-0llvm/include/llvm/IR/RuntimeLibcalls.td
+7-02 files

LLVM/project 3364617llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls aix.ll

PowerPC: Add vec_malloc functions to AIX in RuntimeLibcalls
DeltaFile
+7-0llvm/test/Transforms/Util/DeclareRuntimeLibcalls/aix.ll
+4-0llvm/include/llvm/IR/RuntimeLibcalls.td
+11-02 files

LLVM/project be6441ellvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls emscripten.ll

RuntimeLibcalls: Add small_printf functions to emscripten
DeltaFile
+6-0llvm/test/Transforms/Util/DeclareRuntimeLibcalls/emscripten.ll
+4-0llvm/include/llvm/IR/RuntimeLibcalls.td
+10-02 files

LLVM/project 82b9216clang/lib/Tooling/DependencyScanning DependencyScannerImpl.cpp

Fix UB introduced by be0aa7b6c72bdb162f1f3fe251e469927118963e.
DeltaFile
+3-3clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
+3-31 files

LLVM/project f2495b7llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/Transforms/Util/DeclareRuntimeLibcalls darwin.ll

RuntimeLibcalls: Add macos unlocked IO functions to systems

This is another of the easier to understand conditions from
TargetLibraryInfo
DeltaFile
+9-2llvm/test/Transforms/Util/DeclareRuntimeLibcalls/darwin.ll
+7-1llvm/include/llvm/IR/RuntimeLibcalls.td
+16-32 files