LLVM/project 9f8fc65llvm/lib/Passes PassBuilderPipelines.cpp, llvm/test/Other new-pm-thinlto-prelink-pgo-defaults.ll new-pm-thinlto-postlink-defaults.ll

[Passes] Remove some optsize checks (#189369)

LibCallsShrinkWrapPass and PGOMemOPSizeOpt already check for optsize
attributes internally, so there is no need to handle this in the pass
pipeline.

The context here is that I'd like to make the pass pipeline completely
independent of Os/Oz so that we know for sure that function-level
optsize/minsize attributes behave identically to the pipeline-level
option.
DeltaFile
+2-5llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
+2-5llvm/lib/Passes/PassBuilderPipelines.cpp
+1-3llvm/test/Other/new-pm-thinlto-postlink-defaults.ll
+1-3llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
+1-3llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
+1-3llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
+8-222 files not shown
+10-288 files

LLVM/project 006d8d6llvm/lib/Target/AMDGPU SIFoldOperands.cpp, llvm/test/CodeGen/AMDGPU si-fold-operands-or.mir constant-fold-mi-operands.ll

[AMDGPU][SIFoldOperands] Fix OR -1 fold

In SIFoldOperands, folding `or x, -1` to `v_mov_b32 -1` removed `Src1Idx`,
which is incorrect because `-1` is in `Src0Idx` (after canonicalization).
DeltaFile
+17-0llvm/test/CodeGen/AMDGPU/si-fold-operands-or.mir
+1-1llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+1-1llvm/test/CodeGen/AMDGPU/constant-fold-mi-operands.ll
+19-23 files

LLVM/project 1431107llvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify constant-fold-fp-denormal.ll

[LLVM][ConstantFold] Ensure scalar type is queried when determining denormal mode. (#189600)

Fixes https://github.com/llvm/llvm-project/issues/187928
DeltaFile
+18-0llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll
+2-1llvm/lib/Analysis/ConstantFolding.cpp
+20-12 files

LLVM/project 0435ba3llvm/include/llvm/IR Instruction.h, llvm/include/llvm/Support Alignment.h

feedback + update MetadataRecycleSize only in assert builds

Created using spr 1.3.8-wip
DeltaFile
+7-3llvm/lib/IR/Metadata.cpp
+5-4llvm/lib/IR/Globals.cpp
+3-0llvm/lib/IR/LLVMContextImpl.h
+1-1llvm/include/llvm/Support/Alignment.h
+1-1llvm/lib/IR/LLVMContextImpl.cpp
+0-1llvm/include/llvm/IR/Instruction.h
+17-106 files

LLVM/project e3b6426llvm/test/CodeGen/WebAssembly strided-int-mac.ll

[NFC][WebAssembly] CodeGen test (#189626)
DeltaFile
+379-0llvm/test/CodeGen/WebAssembly/strided-int-mac.ll
+379-01 files

LLVM/project d08ebbeclang/include/clang/ScalableStaticAnalysisFramework SSAFBuiltinForceLinker.h, clang/include/clang/ScalableStaticAnalysisFramework/Analyses/CallGraph CallGraphSummary.h

[clang][ssaf] Add CallGraph summary and extractor (#188753)

rdar://170258016
DeltaFile
+470-0clang/unittests/ScalableStaticAnalysisFramework/Analyses/CallGraph/CallGraphExtractorTest.cpp
+106-0clang/lib/ScalableStaticAnalysisFramework/Analyses/CallGraph/CallGraphExtractor.cpp
+53-0clang/include/clang/ScalableStaticAnalysisFramework/Analyses/CallGraph/CallGraphSummary.h
+3-5clang/unittests/ScalableStaticAnalysisFramework/Registries/SummaryExtractorRegistryTest.cpp
+7-0clang/include/clang/ScalableStaticAnalysisFramework/SSAFBuiltinForceLinker.h
+4-1llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Analyses/BUILD.gn
+643-69 files not shown
+653-715 files

LLVM/project 0ef10d6llvm/lib/Target/SPIRV SPIRVInstrInfo.td, llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_cooperative_matrix cooperative_matrix.ll

[SPIR-V] Fix OpCooperativeMatrixLengthKHR operand type (#189630)

related to #188703
DeltaFile
+1-4llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_cooperative_matrix/cooperative_matrix.ll
+1-1llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
+2-52 files

LLVM/project 33fc8fcllvm/lib/Support APInt.cpp

[Support][APint] Optimize fallback case in APInt::reverseBits (#189291)
DeltaFile
+34-24llvm/lib/Support/APInt.cpp
+34-241 files

LLVM/project 935cf7ellvm/unittests/ADT APIntTest.cpp

[Support][APint] Added more unit tests for clearBits / clearBitsSlowCase (#189434)
DeltaFile
+20-0llvm/unittests/ADT/APIntTest.cpp
+20-01 files

LLVM/project 0274750llvm/lib/Support APInt.cpp, llvm/unittests/ADT APIntTest.cpp

[Support][APint] Fix APInt::urem for edge case. Use `U.pVal[0] instead getZExtValue() (#189441)

Use `U.pVal[0]` instead of `getZExtValue()` in the
`APInt::urem(uint64_t)` power-of-two fast path. `getZExtValue()`
requires the entire APInt to fit into 64 bits, but this code can be
reached for multi-word values, which may trigger assertions
(`assert(getActiveBits() <= 64 && "Too many bits for uint64_t")`) or
otherwise mis-handle wide integers.

Also add simple test for edge cases.

Improvement for https://github.com/llvm/llvm-project/pull/189245
DeltaFile
+23-0llvm/unittests/ADT/APIntTest.cpp
+1-1llvm/lib/Support/APInt.cpp
+24-12 files

LLVM/project 74e84c0clang/lib/CodeGen CGException.cpp, clang/test/CodeGen async-exceptions.c

[Clang] Fix getTerminator() use for -fasync-exceptions (#189644)
DeltaFile
+37-0clang/test/CodeGen/async-exceptions.c
+1-2clang/lib/CodeGen/CGException.cpp
+38-22 files

LLVM/project 5b01013llvm/include/llvm/ADT bit.h

[ADT] implement countl_zero_constexpr and reuse it for countl_zero & bit_width_constexpr (#189111)

Implement constant evaluated `countl_zero_constexpr` similar to
`countr_zero_constexpr` and use it for `countl_zero` and
`bit_width_constexpr`.

Also, `countl_zero` now use fast intrinsic path for `uint8/uint16` types
(use `sizeof(T) <= 4` instead `sizeof(T) == 4`).
DeltaFile
+35-20llvm/include/llvm/ADT/bit.h
+35-201 files

LLVM/project 76ed0adllvm/include/llvm/DebugInfo/CodeView LazyRandomTypeCollection.h, llvm/include/llvm/DebugInfo/PDB/Native TpiStream.h

[CodeView] Expose fallible type accessors in TpiStream (#188299)

`LazyRandomTypeCollection` already has fallible functions for
`getType(TypeIndex)` this exposes them in `TpiStream` and does a mini
cleanup in `LazyRandomTypeCollection`'s `GetType`.

Context: #186948 saw a crash in LLDB where we call `GetType` without
checking the type index before calling the method. In `GetType` we
called `error(std::move(EC))`, which ignores the error in release mode.
The cause was the type index `0x80000169` in an `S_LOCAL`.

We now do a soft fail in release mode - we already check the error, so
we might as well return an empty value.

Aside: The type index there feels really unusual, the type indices in
other records around the `S_LOCAL` were in a similar range. Almost looks
like some integer over-/underflow.
DeltaFile
+142-0llvm/unittests/DebugInfo/PDB/TpiStreamTest.cpp
+14-0llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
+14-0llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
+6-3llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp
+1-0llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
+1-0llvm/unittests/DebugInfo/PDB/CMakeLists.txt
+178-36 files

LLVM/project 8f1d26bclang/lib/Driver ToolChain.cpp, clang/test/Driver Xarch.c

clang: Check -Xarch compatibility using Triple parsed architecture.

This will allow recognizing any of the triple aliases for the architecture.
This will avoid test failures when the amdgcn triple top level architecture
is renamed.
DeltaFile
+5-2clang/lib/Driver/ToolChain.cpp
+1-0clang/test/Driver/Xarch.c
+6-22 files

LLVM/project 26e67aellvm/lib/Target/AArch64 AArch64SystemOperands.td, llvm/test/MC/AArch64 basic-a64-instructions.s armv8.9a-prfm-slc.s

[AArch64] Always print the PRFM operation name (#182035)

When the encoding in the "Rt" field of the PRFM instruction maps to a
`<prfop>` value, the name of the prefetch operation should be printed
regardless of whether the associated feature (e.g. FEAT_PRFMSLC)
is available. If the feature is not available, the instruction is a nop.
All other encodings are printed as an immediate.
DeltaFile
+6-6llvm/test/MC/AArch64/basic-a64-instructions.s
+1-10llvm/test/MC/AArch64/armv8.9a-prfm-slc.s
+1-9llvm/test/MC/Disassembler/AArch64/armv8.9a-prfm-slc.txt
+3-3llvm/test/tools/llvm-mca/AArch64/Cortex/A55-basic-instructions.s
+3-3llvm/test/tools/llvm-mca/AArch64/HiSilicon/tsv110-basic-instructions.s
+0-6llvm/lib/Target/AArch64/AArch64SystemOperands.td
+14-3716 files not shown
+50-7322 files

LLVM/project 54831b4llvm/lib/Frontend/OpenMP OMPContext.cpp

OpenMP: Match all Triple recognized arch aliases

This liberalizes match(device = {arch(some_arch)} to recognize
other names for some_arch.

Previously this compared against getArchTypeForLLVMName, which
only matches a subset of names (which seems to be the canonical
architecture names). There was a special case hack for "x86_64",
which is one of the "x86-64" aliases accepted by parseArch, but is
not the canonical architecture name.
DeltaFile
+2-9llvm/lib/Frontend/OpenMP/OMPContext.cpp
+2-91 files

LLVM/project 03dfc12llvm/include/llvm/TargetParser Triple.h, llvm/lib/TargetParser Triple.cpp

Triple: Expose parseArch as a public method

Clang has some code which is doing a direct arch name
string compare which should really be recognizing anything
usable as a triple architecture. It makes more sense to
directly parse the architecture than to construct a temporary
triple just to see what the parsed arch is.

For some reason the existing public parsing method is
getArchTypeForLLVMName. I'm not fully sure what the difference between
the 2 is supposed to be. My current guess is getArchTypeForLLVMName is
only supposed to handle the canonical architecture name.
DeltaFile
+4-0llvm/include/llvm/TargetParser/Triple.h
+1-1llvm/lib/TargetParser/Triple.cpp
+5-12 files

LLVM/project a30a8e9flang/lib/Lower/OpenMP DataSharingProcessor.cpp, flang/test/Lower/OpenMP composite_simd_linear.f90 distribute-parallel-do-simd.f90

Reland "[flang][OpenMP] Fix lowering of LINEAR iteration variables (#183794)" (#188851)

Linear iteration variables were being treated as private. This fixes
one of the issues reported in #170784.

The regression reported in #188536 occurred because
LinearClauseProcessor was rewriting all basic blocks whose names
contained a given substring, including those that were not part of the
translated SIMD region.
This didn't cause problems before because linear variables were always
privatized, which doesn't happen with this change.
The issue is fixed by rewriting only the basic blocks that correspond to
the omp.simd operation.
DeltaFile
+47-17mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+34-0mlir/test/Target/LLVMIR/openmp-simd-linear.mlir
+13-12flang/test/Lower/OpenMP/composite_simd_linear.f90
+12-13flang/test/Lower/OpenMP/distribute-parallel-do-simd.f90
+8-5flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+5-5flang/test/Lower/OpenMP/wsloop-simd.f90
+119-525 files not shown
+135-6511 files

LLVM/project 0948f7bllvm CMakeLists.txt, openmp/runtime CMakeLists.txt

CMake fixes
DeltaFile
+8-8openmp/runtime/cmake/arm64x.cmake
+2-2llvm/CMakeLists.txt
+1-2openmp/runtime/CMakeLists.txt
+11-123 files

LLVM/project 5d4f68allvm CMakeLists.txt, llvm/runtimes CMakeLists.txt

[openmp] Add support for Arm64X to libomp

This patch allows building libomp.dll and libomp.lib as Arm64X binaries
containing both arm64 and arm64ec code and useable from applications
compiled for both architectures.
DeltaFile
+97-0openmp/runtime/cmake/arm64x.cmake
+16-0llvm/CMakeLists.txt
+11-0openmp/runtime/CMakeLists.txt
+6-0llvm/runtimes/CMakeLists.txt
+130-04 files

LLVM/project d5f7acdmlir/include/mlir/Dialect/SPIRV/IR SPIRVTosaOps.td SPIRVTosaTypes.td, mlir/test/Dialect/SPIRV/IR tosa-ops-verification.mlir tosa-ops.mlir

[mlir][spirv] Add Cast/Rescale ops in TOSA Ext Inst Set (#189028)

This patch introduces the following operators:

spirv.Tosa.Cast
spirv.Tosa.Rescale

Also dialect and serialization round-trip tests have been added.

Signed-off-by: Davide Grohmann <davide.grohmann at arm.com>
DeltaFile
+184-0mlir/test/Dialect/SPIRV/IR/tosa-ops-verification.mlir
+133-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVTosaOps.td
+61-0mlir/test/Target/SPIRV/tosa-ops.mlir
+37-0mlir/test/Dialect/SPIRV/IR/tosa-ops.mlir
+21-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVTosaTypes.td
+11-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
+447-01 files not shown
+448-07 files

LLVM/project 5d051f6clang/lib/Basic/Targets AMDGPU.cpp AMDGPU.h

clang: Remove unnecessary isAMDGCN wrapper (#189640)
DeltaFile
+12-14clang/lib/Basic/Targets/AMDGPU.cpp
+3-5clang/lib/Basic/Targets/AMDGPU.h
+15-192 files

LLVM/project e54f9c7clang/lib/CodeGen CGException.cpp, clang/test/CodeGen async-exceptions.c

[spr] initial version

Created using spr 1.3.8-wip
DeltaFile
+37-0clang/test/CodeGen/async-exceptions.c
+1-2clang/lib/CodeGen/CGException.cpp
+38-22 files

LLVM/project a839e50llvm/test/CodeGen/SPIRV/passes SPIRVEmitIntrinsics-infer-fnptr-todo-type.ll

[NFC][SPIRV] Add test for untested case in SPIRVEmitIntrinsics  (#189413)

[This
case](https://github.com/llvm/llvm-project/blob/af98e3c2cb07af90029785a78e49c2761f20088e/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp#L1233-L1236)
is not tested by any existing test (checked using code coverage and by
inserting an `abort`). The case marks type deduction as incomplete.

I suggest a new test to cover this case; it's specific to
`-mtriple=spirv64-amd-amdhsa`.
DeltaFile
+21-0llvm/test/CodeGen/SPIRV/passes/SPIRVEmitIntrinsics-infer-fnptr-todo-type.ll
+21-01 files

LLVM/project 67d4842llvm/test/CodeGen/AMDGPU si-lower-sgpr-spills.mir

[NFC][AMDGPU] New test for untested case in SILowerSGPRSpills  (#189426)

[This
case](https://github.com/llvm/llvm-project/blob/f380a878d515024fe02662471e81cd72a8b3eb93/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp#L343-L345)
is not covered by any existing tests (checked using code coverage and by
inserting an `abort` at that line). I propose a new test that tests this
line.

This is demonstrated by showing that it is the only test that fails in
the presence of the `abort`.
DeltaFile
+75-9llvm/test/CodeGen/AMDGPU/si-lower-sgpr-spills.mir
+75-91 files

LLVM/project 161c53fopenmp/runtime CMakeLists.txt, openmp/runtime/src kmp_invoke_microtask.cpp z_Linux_util.cpp

[openmp] Add support for arm64ec to libomp (#176151)

This patch adds arm64ec support to libomp.
Note that this support isn't entirely usable on Windows hosts as libomp
requires LLVM_PER_TARGET_RUNTIME_DIR=On for to work correctly when
multiple runtimes are built, which is unsupported on Windows. A
following patch will add arm64x support to the build to rectify this.
DeltaFile
+140-0openmp/runtime/src/kmp_invoke_microtask.cpp
+0-139openmp/runtime/src/z_Linux_util.cpp
+6-4openmp/runtime/src/kmp_os.h
+6-2openmp/runtime/src/kmp_platform.h
+5-1openmp/runtime/CMakeLists.txt
+4-2openmp/runtime/src/z_Windows_NT-586_util.cpp
+161-1489 files not shown
+178-15215 files

LLVM/project f14b865lldb/include/lldb/Target MemoryRegionInfo.h, lldb/unittests/Process/Utility LinuxProcMapsTest.cpp MemoryTagManagerAArch64MTETest.cpp

[lldb] Remove "flash" and "blocksize" from MemoryRegionInfo constructor (#189636)

These are only set to non-default values after calling a constructor.
Removing them removes noise from many tests that make MemoryRegionInfos.
DeltaFile
+40-44lldb/unittests/Process/minidump/MinidumpParserTest.cpp
+17-34lldb/unittests/Process/Utility/LinuxProcMapsTest.cpp
+2-4lldb/include/lldb/Target/MemoryRegionInfo.h
+1-2lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp
+60-844 files

LLVM/project 914fca4llvm/tools/llc llc.cpp

[llc] Change `TargetMachine` allocation assert to error (#189541)

As we shouldn't assert an allocation (which can fail).

---------

Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
DeltaFile
+10-2llvm/tools/llc/llc.cpp
+10-21 files

LLVM/project 7389ef9clang/lib/Basic/Targets AMDGPU.cpp AMDGPU.h

clang: Remove unnecessary isAMDGCN wrapper
DeltaFile
+12-14clang/lib/Basic/Targets/AMDGPU.cpp
+3-5clang/lib/Basic/Targets/AMDGPU.h
+15-192 files

LLVM/project 68a91f3llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Remove ExtraGCD from GCD MIV (NFC) (#172004)

As some code was removed in #169927, `ExtraGCD` in `gcdMIVtest` is no
longer necessary. This patch removes it and also adjust the comments.
DeltaFile
+1-7llvm/lib/Analysis/DependenceAnalysis.cpp
+1-71 files