LLVM/project c221e2allvm/lib/Target/Hexagon HexagonLoopIdiomRecognition.cpp, llvm/test/CodeGen/Hexagon/loop-idiom pmpy-trunc.ll

[Hexagon] Handle trunc to i1 in matchRightShift (#174737)

Fix of test regression seen when working on
https://github.com/llvm/llvm-project/issues/172888

this will handle "trunc(x) to i1" as "icmp_ne(and(x,1),0)"
updates matchRightShift to match this pattern and promoteTo to map the
trunc to "icmp_ne(and(x,1),0)"
DeltaFile
+122-0llvm/test/CodeGen/Hexagon/loop-idiom/pmpy-trunc.ll
+23-0llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
+145-02 files

LLVM/project 6d2a2e6llvm/lib/Target/RISCV RISCVInstrInfoV.td RISCVInstrFormats.td

[RISCV] Make ElementsDependOn opt-in instead of opt-out. NFCI (#181601)

RISCVVectorPeephole and RISCVVLOptimizer use the ElementsDependOn field
to know if it's safe to change the VL of a vector instruction.

By default instructions are EltDepsNone, i.e.
RISCVVectorPeephole::tryReduceVL will reduce its VL by default, but we
might forget to mark unsafe instructions in newer extensions. This patch
changes the default to EltDepsVLMask and instead explicitly marks any
instructions which want to have their VL reduced.

There is an assert in RISCVVLOptimizer::isCandidate that ensures that
all previously isSupported instructions are still marked correctly.
DeltaFile
+62-28llvm/lib/Target/RISCV/RISCVInstrInfoV.td
+5-4llvm/lib/Target/RISCV/RISCVInstrFormats.td
+3-3llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
+4-2llvm/lib/Target/RISCV/RISCVInstrInfoXRivos.td
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoZvabd.td
+78-413 files not shown
+83-449 files

LLVM/project 9d7c786llvm/test/CodeGen/X86 known-pow2.ll

[X86] Add vector demanded elts pow2 test for #183270 (#183327)

DeltaFile
+30-0llvm/test/CodeGen/X86/known-pow2.ll
+30-01 files

LLVM/project 1e676e7llvm/unittests/CodeGen SelectionDAGPatternMatchTest.cpp SelectionDAGNodeConstructionTest.cpp, llvm/unittests/Target/AArch64 AArch64SelectionDAGTest.cpp

[SelectionDAG] Use virtual registers instead of arbitrary physical registers in unit tests. NFC (#183205)

These tests use constants in the physical register space. These will
correspond to different registers on different targets and aren't
stable.

Using virtual registers makes more sense here. This will print in a
coherent way if you anyone were to dump the DAG created by these tests.
DeltaFile
+144-72llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
+38-19llvm/unittests/CodeGen/SelectionDAGNodeConstructionTest.cpp
+8-4llvm/unittests/Target/AArch64/AArch64SelectionDAGTest.cpp
+8-4llvm/unittests/Target/X86/X86SelectionDAGTest.cpp
+198-994 files

LLVM/project f5f07a8mlir/test/Analysis/DataFlow test-liveness-analysis.mlir, mlir/test/lib/Analysis/DataFlow TestLivenessAnalysis.cpp

[mlir][Analysis] Print all blocks in `-test-liveness-analysis` (#183308)

Improve the output of the test pass: print liveness for block arguments
from all blocks.
DeltaFile
+26-3mlir/test/Analysis/DataFlow/test-liveness-analysis.mlir
+10-7mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
+36-102 files

LLVM/project dc97792libcxx/utils/ci/lnt run-benchmarks

[libc++] Use verbose output when a LNT benchmark fails
DeltaFile
+1-1libcxx/utils/ci/lnt/run-benchmarks
+1-11 files

LLVM/project 305a8fdclang/docs ReleaseNotes.rst, clang/lib/AST ASTContext.cpp

[clang] allow canonicalizing assumed template names (#183222)

Assumed template names are part of error recovery and encode just a
declaration name, making them always canonical. This patch allows them
to be canonicalized, which is trivial.

Fixes #183075
DeltaFile
+13-0clang/test/SemaTemplate/GH183075.cpp
+5-2clang/lib/AST/ASTContext.cpp
+1-0clang/docs/ReleaseNotes.rst
+19-23 files

LLVM/project 118f64allvm/lib/Target/RISCV RISCVISelLowering.cpp RISCVSubtarget.cpp, llvm/test/CodeGen/RISCV rvp-unaligned-load-store.ll rvp-ext-rv32.ll

[RISCV] Remove -riscv-enable-p-ext-simd-codegen (#183156)

All known crashes have been fixed.

We do still need to work out how fixed length vectors are handled when V
and P are both enabled, but I don't think this option is the solution
for that.
DeltaFile
+12-12llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+4-8llvm/test/CodeGen/RISCV/rvp-unaligned-load-store.ll
+1-11llvm/lib/Target/RISCV/RISCVSubtarget.cpp
+6-6llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+3-3llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+2-2llvm/test/CodeGen/RISCV/rvp-ext-rv32.ll
+28-424 files not shown
+32-4610 files

LLVM/project 333ef64llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv fixed-vectors-reduction-cmp.ll

[RISCV] Remove unnecessary And before seteq/ne in some cases. (#183221)

Fold (and X, Mask) ==/!= C -> X ==/!= sext(C, countr_one(Mask))if the
Mask is only clearing redundant sign bits.

The AND may have come from type legalization of a narrower setcc.
Type legalization will check computeNumSignBits before inserting
the AND, but sometimes the sign bits don't appear until after
op legalization. In the motivating examples, the inputs isn't known
to be sign extended until EXTRACT_VECTOR_ELT is converted to vmv.x.s.

Spotted in the before code from #182684.
DeltaFile
+36-0llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-cmp.ll
+12-0llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+48-02 files

LLVM/project 219b5a0llvm/cmake/modules HandleLLVMOptions.cmake

build: alter condition for adding `_DEBUG` CPP macro (#183120)

Unlike many other platforms, Microsoft does not maintain ABI across
debug and release binaries. When building LLVM in release+asserts, the
injection of `_DEBUG` which controls the behaviour of `assert` as per
the C specification, also alters the behaviour of the C/C++ runtime's
internal assertions and relies on debug only symbols. As such, the
`_DEBUG` macro handling is not _MSVC_ specific but rather MS STL and
UCRT specific. Adjust the build condition from `MSVC` to `WIN32` to
indicate that this is a Windows-ism. Note that `MINGW` is the proper way
to check for MinGW, so that should not be impacted by this change.
Making this more precise permits the use of `clang` and `clang++` to
build LLVM for Windows.
DeltaFile
+2-2llvm/cmake/modules/HandleLLVMOptions.cmake
+2-21 files

LLVM/project e044af8llvm/include/llvm/IR pch.h, llvm/lib/IR CMakeLists.txt

[CMake][IR] Add PCH (#183303)

Add PCH with most-used and expensive headers from llvm/IR.
DeltaFile
+31-0llvm/include/llvm/IR/pch.h
+3-0llvm/lib/IR/CMakeLists.txt
+34-02 files

LLVM/project e199191mlir/test/Dialect/Tosa availability.mlir, mlir/test/lib/Dialect/Tosa TestAvailability.cpp

[mlir][tosa] Converted TosaAvailability pass to ModuleOp from FuncOp, fixes crash in threaded pass manager (#183063)

The `TosaAvailability` pass originally worked on a per function basis
and was automatically threaded, however it used llvm::outs() which
involves the thread-unsafe `raw_ostream`.

To fix this, we convert the pass into a pass over `ModuleOp` instead of
`FuncOp`s, and iterate sequentially over all functions instead. This
removes all threading and we no longer require `-mlir-disable-threading`
which is mentioned in TosaAvailability's `availability.mlir` test.

Closes #182255.
DeltaFile
+40-38mlir/test/lib/Dialect/Tosa/TestAvailability.cpp
+1-1mlir/test/Dialect/Tosa/availability.mlir
+41-392 files

LLVM/project 7d492dbutils/bazel/llvm-project-overlay/llvm BUILD.bazel

[bazel] Fix build format (#183322)

DeltaFile
+0-1utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+0-11 files

LLVM/project 8d2d8bellvm/include/llvm/IR MDBuilder.h, llvm/lib/IR MDBuilder.cpp

[profcheck] Expose likely/unlikely weights as constants in MDBuilder (#183252)

Define `kLikelyBranchWeight` and `kUnlikelyBranchWeight` as static
constexpr members in MDBuilder.h and use them in
createLikelyBranchWeights and createUnlikelyBranchWeights. This makes
the weights used for likely/unlikely branches more discoverable and
reusable.

Co-authored-by: Jin Huang <jingold at google.com>
DeltaFile
+14-0llvm/include/llvm/IR/MDBuilder.h
+2-2llvm/lib/IR/MDBuilder.cpp
+16-22 files

LLVM/project 19128bfutils/bazel/llvm-project-overlay/libc BUILD.bazel libc_build_rules.bzl

[bazel][libc] Add some deps for layering_check (#183235)

This adds a whole bunch of deps to get things _mostly_ building w/
`layering_check` enabled. It does not yet enable `layering_check`.

I used some tools to add deps to all these targets that break when
enabling the layering check feature, and a few things were added in
between when I ran the script and where trunk is at now. Since this is a
large change, I plan to do a second (and possibly third) pass later to
catch those new changes, at which point it would be safer to actually
enable `layering_check` for this package.
DeltaFile
+1,288-141utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+5-1utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+1,293-1422 files

LLVM/project a450e16clang/lib/CodeGen/TargetBuiltins ARM.cpp

[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (3/N) (NFC)

Remove the outstanding calls to `EmitScalarExpr` in
`EmitAArch64BuiltinExpr` that are no longer required.

This is a follow-up for #181794 and #181974 - please refer to that PR
for more context.
DeltaFile
+32-65clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+32-651 files

LLVM/project d46089dclang/docs ReleaseNotes.rst, clang/lib/AST ASTContext.cpp

[clang] allow canonicalizing assumed template names

Assumed template names are part of error recovery and encode just a
declaration name, making them always canonical. This patch allows
them to be canonicalized, which is trivial.

Fixes #183075
DeltaFile
+13-0clang/test/SemaTemplate/GH183075.cpp
+5-2clang/lib/AST/ASTContext.cpp
+1-0clang/docs/ReleaseNotes.rst
+19-23 files

LLVM/project 5eb307eclang/include/clang/AST Decl.h, clang/lib/AST Decl.cpp

[clang][TypePrinter][NFC] Extract logic that handles AnonymousTagNameStyle::SourceLocation into helper function (#183304)

In https://github.com/llvm/llvm-project/pull/168533 we're adding a new
`AnonymousTagMode` and will be handled in `printAnonymousTagDecl`.

This patch extracts the logic that handles
`AnonymousTagNameStyle::SourceLocation` into a helper function to make
`printAnonymousTagDecl` easier to follow.

Drive-by changes:
* While copying the code into the helper I changed it to use
early-return style.
DeltaFile
+26-22clang/lib/AST/Decl.cpp
+3-0clang/include/clang/AST/Decl.h
+29-222 files

LLVM/project 787ba24clang/docs ReleaseNotes.rst, clang/lib/Sema SemaTemplateDeduction.cpp

[clang] create local instantiation scope for matching template template parameters (#183219)

This fixes a bug where a partial substitution from the enclosing scope
is used to prepopulate an unrelated template argument deduction.

Fixes #181166
DeltaFile
+7-0clang/test/SemaTemplate/temp_arg_template_p0522.cpp
+4-2clang/docs/ReleaseNotes.rst
+2-0clang/lib/Sema/SemaTemplateDeduction.cpp
+13-23 files

LLVM/project 3d25128lldb/docs index.rst, lldb/source/Plugins/Process/FreeBSD-Kernel-Core RegisterContextFreeBSDKernelCore_arm.cpp RegisterContextFreeBSDKernelCore_arm.h

[lldb][Process/FreeBSDKernel] Add arm support (#180674)

This is LLDB version of
https://cgit.freebsd.org/ports/tree/devel/gdb/files/kgdb/arm-fbsd-kern.c.
This enables selecting arm and reading registers from PCB structure on
core dump and live kernel debugging while trapframe unwinding support
will be implemented in future. Test files using core dump from arm will
be implemented once other kernel debugging improvements are done.

---------

Signed-off-by: Minsoo Choo <minsoochoo0122 at proton.me>
DeltaFile
+102-0lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
+41-0lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
+7-0lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
+1-1lldb/docs/index.rst
+1-0lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt
+1-0llvm/docs/ReleaseNotes.md
+153-16 files

LLVM/project e77f11cllvm/include/llvm/CodeGen TargetRegisterInfo.h, llvm/lib/CodeGen TargetRegisterInfo.cpp

[NFC][RegisterInfoEmitter] Add target name prefix for a few variables (#183074)

Add target name prefix for a few static global variables in the
generated code. Also rework the TargetRegisterInfo constructor a bit to
use a ArrayRef for array of register classes and rename a few
constructor arguments to match the member names they initialize.
DeltaFile
+38-43llvm/utils/TableGen/RegisterInfoEmitter.cpp
+14-11llvm/lib/CodeGen/TargetRegisterInfo.cpp
+8-6llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+4-4llvm/test/TableGen/RegisterInfoEmitter-regcost-list.td
+4-4llvm/test/TableGen/RegisterInfoEmitter-regcost.td
+2-5llvm/unittests/CodeGen/MFCommon.inc
+70-731 files not shown
+73-767 files

LLVM/project 9d98151llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp

Capitalize again
DeltaFile
+63-61llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+63-611 files

LLVM/project de75b41llvm/lib/Target/AMDGPU AMDGPUISelLowering.cpp

Capitalize
DeltaFile
+41-41llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+41-411 files

LLVM/project 829cde3llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp AMDGPUISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.exp10.f64.ll llvm.exp.f64.ll

AMDGPU: Implement expansion for f64 exp

I asked AI to port the device libs reference implementation.
It mostly worked, though it got the compares wrong and also
missed a fold that happened in compiler. With that fixed I get
identical DAG output, and almost the same globalisel output (differing
by an inverted compare and select). Also adjusted some stylistic choices.
DeltaFile
+11,178-0llvm/test/CodeGen/AMDGPU/llvm.exp10.f64.ll
+10,242-0llvm/test/CodeGen/AMDGPU/llvm.exp.f64.ll
+9,987-0llvm/test/CodeGen/AMDGPU/llvm.exp2.f64.ll
+117-9llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+116-1llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+31-7llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+31,671-176 files not shown
+31,729-6512 files

LLVM/project 5b7a906clang/lib/CodeGen/TargetBuiltins ARM.cpp

[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (3/N) (NFC)

Remove the outstanding calls to `EmitScalarExpr` in
`EmitAArch64BuiltinExpr` that are no longer required.

This is a follow-up for #181794 and #181974 - please refer to that PR
for more context.
DeltaFile
+34-65clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+34-651 files

LLVM/project cb9f3eellvm/lib/Target/SPIRV SPIRVSubtarget.cpp, llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_relaxed_printf_string_address_space non-constant-printf.ll

[SPIRV] Enable SPV_EXT_relaxed_printf_string_address_space by default for Intel (#183103)

It's easy to hit the address space limitation when using printf locally,
so just enable the extension by default for Intel.

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
DeltaFile
+4-1llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
+1-0llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_relaxed_printf_string_address_space/non-constant-printf.ll
+5-12 files

LLVM/project 8bbb24ecompiler-rt/lib/builtins/arm/thumb1 fcmp.h cmpsf2.S

Rename Thumb1 SetResultRegister to ReturnResult

Also remove the return instructions following it in the main macro,
which aren't needed, since it does the returning itself.
DeltaFile
+10-14compiler-rt/lib/builtins/arm/thumb1/fcmp.h
+1-1compiler-rt/lib/builtins/arm/thumb1/cmpsf2.S
+1-1compiler-rt/lib/builtins/arm/thumb1/gesf2.S
+12-163 files

LLVM/project a498580clang/docs LifetimeSafety.rst index.rst

Apply changes from code browser

Apply changes from code browser
DeltaFile
+296-154clang/docs/LifetimeSafety.rst
+1-0clang/docs/index.rst
+297-1542 files

LLVM/project 6e9fdd3llvm/lib/Transforms/InstCombine InstCombineLoadStoreAlloca.cpp, llvm/lib/Transforms/Utils Local.cpp

[InstCombine] Replace alloca with undef size with poison instead of null

When an alloca instruction has an undef (or poison) array size, InstCombine
was previously replacing all uses of the alloca with a null pointer. This
caused invalid IR when the alloca was used by @llvm.lifetime intrinsics.

According to the @llvm.lifetime intrinsic specification, the pointer
argument must be either:
  - A pointer to an alloca instruction, or
  - A poison value

Since null is neither an alloca pointer nor poison, the previous
transformation violated the intrinsic's requirements and produced
invalid IR.

Fix by replacing the alloca with a poison value instead of null, which
satisfies the @llvm.lifetime requirements and produces valid IR.
DeltaFile
+32-0llvm/test/Transforms/InstCombine/alloca-poison-size.ll
+0-30llvm/test/Transforms/InstCombine/invalid-alloca-poison-size.ll
+0-4llvm/lib/Transforms/Utils/Local.cpp
+1-1llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+33-354 files

LLVM/project ab2c26dcompiler-rt/lib/builtins/arm/thumb1 dcmp.h cmpdf2.S

Rename Thumb1 SetResultRegister to ReturnResult

Also remove the return instructions following it in the main macro,
which aren't needed, since it does the returning itself.
DeltaFile
+13-20compiler-rt/lib/builtins/arm/thumb1/dcmp.h
+1-1compiler-rt/lib/builtins/arm/thumb1/cmpdf2.S
+1-1compiler-rt/lib/builtins/arm/thumb1/gedf2.S
+15-223 files