LLVM/project 7e52722llvm/lib/CodeGen AtomicExpandPass.cpp, llvm/test/CodeGen/AMDGPU store-atomic-flat.ll load-atomic-flat.ll

[CodeGen][AMDGPU] Allow elementwise atomic load/store at element alignment
DeltaFile
+120-0llvm/test/CodeGen/AMDGPU/load-atomic-global.ll
+72-0llvm/test/CodeGen/AMDGPU/store-atomic-global.ll
+36-5llvm/lib/CodeGen/AtomicExpandPass.cpp
+40-0llvm/test/CodeGen/AMDGPU/load-atomic-flat.ll
+37-0llvm/test/Transforms/AtomicExpand/AMDGPU/unaligned-atomic.ll
+24-0llvm/test/CodeGen/AMDGPU/store-atomic-flat.ll
+329-54 files not shown
+365-1210 files

LLVM/project e781ad8llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp

Rename isAtomicAlignmentSupported
DeltaFile
+2-2llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+2-2llvm/include/llvm/CodeGen/TargetLowering.h
+4-42 files

LLVM/project 1262264llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp

Update for comments
DeltaFile
+7-3llvm/include/llvm/CodeGen/TargetLowering.h
+2-4llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+9-72 files

LLVM/project 39c6775llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp

Update for comments
DeltaFile
+5-5llvm/include/llvm/CodeGen/TargetLowering.h
+2-2llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+7-72 files

LLVM/project ceca47cllvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp

[CodeGen] Pass the atomic instruction to supportsUnalignedAtomics
DeltaFile
+2-2llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+3-1llvm/include/llvm/CodeGen/TargetLowering.h
+5-32 files

LLVM/project cb0ddddllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-reduce-xor.ll

[X86] Fix VECREDUCE_XOR to PARITY lowering for 16-bit elements (#219216)

We can't lower vecreduce.xor to parity(movmsk) if the movmsk doesn't
match the element size. For 16-bit elements we'd use movmskb, which
would result in two bits per element, which are always the same. Thus
the parity is always zero.

Disclosure: Test case identified by AI, patch is my own.
DeltaFile
+33-0llvm/test/CodeGen/X86/vector-reduce-xor.ll
+7-1llvm/lib/Target/X86/X86ISelLowering.cpp
+40-12 files

LLVM/project 5fe9365llvm/lib/Target/SPIRV SPIRVBuiltins.cpp, llvm/test/CodeGen/SPIRV AtomicBuiltinsFloat.ll

[SPIR-V] Honor explicit memory_order/memory_scope in atomic load/store (#215572)

atomic_load_explicit and atomic_store_explicit ignored their
memory_order/memory_scope arguments

Translate the explicit arguments via the existing
buildMemSemanticsReg/buildScopeReg helpers, as buildAtomicRMWInst
already does
DeltaFile
+73-55llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+12-3llvm/test/CodeGen/SPIRV/AtomicBuiltinsFloat.ll
+85-582 files

LLVM/project 9a96f02llvm/test lit.cfg.py

[gold] Handle absence of gold linker in tests (#219901)

If we get a NOTFOUND executable, directly report plugin support
as unavailable, instead of trying to invoke the linker.

This fixes a regression from #130981.
DeltaFile
+4-0llvm/test/lit.cfg.py
+4-01 files

LLVM/project bfe1283clang/test/SemaCXX expansion-statements-local-extern-decls.cpp

[Sema][NFC] Add additional tests for declarations in expansion statements (#211948)

I came up with these additional tests for declarations in expansion
statements that previously failed but now correctly diagnose the errors.
DeltaFile
+26-0clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+26-01 files

LLVM/project 13787e6llvm/lib/CodeGen AtomicExpandPass.cpp, llvm/test/CodeGen/AMDGPU store-atomic-flat.ll load-atomic-flat.ll

[CodeGen][AMDGPU] Allow elementwise atomic load/store at element alignment
DeltaFile
+120-0llvm/test/CodeGen/AMDGPU/load-atomic-global.ll
+72-0llvm/test/CodeGen/AMDGPU/store-atomic-global.ll
+36-5llvm/lib/CodeGen/AtomicExpandPass.cpp
+40-0llvm/test/CodeGen/AMDGPU/load-atomic-flat.ll
+37-0llvm/test/Transforms/AtomicExpand/AMDGPU/unaligned-atomic.ll
+24-0llvm/test/CodeGen/AMDGPU/store-atomic-flat.ll
+329-54 files not shown
+366-1210 files

LLVM/project f8ca8fcllvm/include/llvm/Analysis LoopAccessAnalysis.h, llvm/lib/Analysis LoopAccessAnalysis.cpp

[LAA] Give the symbolic strides map a named type (NFC) (#216731)

LoopAccessInfo collects SCEVUnknown strides, collectStridedAccess casts
to it when inserting, but the map was typed as holding a plain SCEV, so
the invariant had to be restated at each use.
DeltaFile
+31-30llvm/lib/Analysis/LoopAccessAnalysis.cpp
+11-9llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+4-4llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+3-4llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+1-1llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+51-492 files not shown
+53-518 files

LLVM/project 7300eddllvm/lib/Target/LoongArch LoongArchISelLowering.cpp LoongArchLateBranchOpt.cpp, llvm/test/CodeGen/LoongArch jr-without-ra.ll branch-opt.ll

[LoongArch] Add late branch optimization pass (#216261)

The patch adds a late optimization pass that replaces conditional
branches that can be statically evaluated with an unconditinal branch.

This pass is inspired by RISC-V's RISCVLateBranchOpt pass.
DeltaFile
+43-308llvm/test/CodeGen/LoongArch/branch-opt.ll
+121-0llvm/lib/Target/LoongArch/LoongArchLateBranchOpt.cpp
+46-72llvm/test/CodeGen/LoongArch/jr-without-ra.ll
+17-23llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.nogenerated.expected
+17-23llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.generated.expected
+14-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+258-4266 files not shown
+274-43612 files

LLVM/project 2852d0dllvm/test/CodeGen/LoongArch branch-opt.ll

[LoongArch][NFC] Add tests for constant branch optimization (#216258)
DeltaFile
+408-0llvm/test/CodeGen/LoongArch/branch-opt.ll
+408-01 files

LLVM/project a6baa3fclang/lib/AST/ByteCode InterpFrame.cpp ByteCodeEmitter.cpp, clang/test/AST/ByteCode virtual-bases.cpp

[clang][bytecode] Keep sourcemaps smaller (#219878)

Only add new entries if they are different than the currently last
entry. This means we won't have an entry for _all_ opcodes in the source
map anymore.
DeltaFile
+14-4clang/lib/AST/ByteCode/Source.h
+3-3clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
+2-3clang/test/AST/ByteCode/virtual-bases.cpp
+1-2clang/lib/AST/ByteCode/InterpFrame.cpp
+20-124 files

LLVM/project 989f933libcxx/include/__cxx03 limits __config

[libc++] Remove NaCl support from __cxx03 headers (#219787)

Completes the NaCl cleanup started in #148983 by removing the remaining
references from the frozen `__cxx03/` headers.

Changes:

* Remove the `_LIBCPP_USING_NACL_RANDOM` comment block and
`#elif defined(__native_client__)` branch from
`include/__cxx03/__config`
* Remove `defined(__pnacl__)` from the `#if` condition in
  `include/__cxx03/limits`

The `_LIBCPP_USING_NACL_RANDOM` macro was defined but never consumed;
its
previous consumer in `src/random.cpp` was already removed in #148983.

Fixes #219588
DeltaFile
+0-9libcxx/include/__cxx03/__config
+1-1libcxx/include/__cxx03/limits
+1-102 files

LLVM/project cadec7cllvm/test/CodeGen/AMDGPU si-pre-allocate-wwm-regs-preserve-rci.mir

[CodeGen][AMDGPU] Fixed FileCheck patterns in #212201 regression test (#219683)

Quick follow up to fix failures from merging #212201. Removes `llvm::`
from FileCheck in `si-preallocate-wwm-regs-preserve.mir` test.
DeltaFile
+2-2llvm/test/CodeGen/AMDGPU/si-pre-allocate-wwm-regs-preserve-rci.mir
+2-21 files

LLVM/project 1cd644dllvm/include/llvm/ADT APFloat.h, llvm/lib/Support APFloat.cpp

[LLVM] [ADT] Move isLosslesslyConvertibleTo to APFloat (#218324)

See the comments in https://github.com/llvm/llvm-project/pull/214658 for
motivation.

AI assisted.
DeltaFile
+148-0llvm/unittests/ADT/APFloatTest.cpp
+5-69mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+64-0llvm/lib/Support/APFloat.cpp
+8-0llvm/include/llvm/ADT/APFloat.h
+225-694 files

LLVM/project aa00f13clang/lib/AST/ByteCode Interp.cpp

[clang][bytecode] Iterate scope only once in Destroy() (#219874)

Call deallocate() here directly instead of iterating the scope again in
`InterpFrame::destroy()`.
DeltaFile
+12-6clang/lib/AST/ByteCode/Interp.cpp
+12-61 files

LLVM/project 7c8c810llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/PhaseOrdering/X86 pr217598.ll

[VectorCombine] Allow equal-cost scalarization for single-use loads (#218340)

Allow scalarizeLoadExtract to scalarize a single-use vector load when
the scalarized cost is equal to the original cost.

For a single extract user, this does not increase the number of memory
operations and narrows the memory access, which can expose further
optimizations such as store-to-load forwarding and DSE.

Keep requiring a strict cost improvement for loads with multiple users.

Proof https://alive2.llvm.org/ce/z/YAck5U
Fixes https://github.com/llvm/llvm-project/issues/217598
DeltaFile
+112-0llvm/test/Transforms/PhaseOrdering/X86/pr217598.ll
+36-23llvm/test/Transforms/VectorCombine/X86/load.ll
+6-6llvm/test/Transforms/VectorCombine/X86/load-inseltpoison.ll
+3-1llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+157-304 files

LLVM/project b0c8161mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-todo.mlir openmp-target-launch-host.mlir

Updates after rebase to latest main
DeltaFile
+5-5mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+4-2mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+1-1mlir/test/Target/LLVMIR/openmp-todo.mlir
+1-1mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+11-94 files

LLVM/project ccde28fllvm/lib/Target/LoongArch LoongArchISelLowering.cpp, llvm/test/CodeGen/LoongArch atomicrmw-cond-sub-clamp.ll sextw-removal.ll

[LoongArch] Fold selects sharing operands with binary operations (#215520)

Fold selects of the form
  select C, (binop X, Y), X
into
  binop X, (select C, Y, 0)

Support ADD, OR, XOR, and eligible SUB patterns while preserving the
operand-order restrictions of SUB.
DeltaFile
+95-173llvm/test/CodeGen/LoongArch/select-binop-combine.ll
+137-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+18-24llvm/test/CodeGen/LoongArch/sextw-removal.ll
+8-16llvm/test/CodeGen/LoongArch/atomicrmw-cond-sub-clamp.ll
+258-2134 files

LLVM/project 22756a0llvm/test/CodeGen/LoongArch select-binop-combine.ll

[LoongArch][NFC] Add tests for select-binop DAG combine (#215519)
DeltaFile
+835-0llvm/test/CodeGen/LoongArch/select-binop-combine.ll
+835-01 files

LLVM/project 7a528e1llvm/test/Transforms/LoopVectorize early-exit-trip-count-may-cause-ub.ll

[NFC][LoopVectorize] Add test for early-exit trip count that may cause UB … (#219883)

Pre-commit test for https://github.com/llvm/llvm-project/issues/219371,
where a udiv in the trip count is speculated into the preheader even
when its divisor may be poison.
DeltaFile
+150-0llvm/test/Transforms/LoopVectorize/early-exit-trip-count-may-cause-ub.ll
+150-01 files

LLVM/project 8b6145dllvm/docs NVPTXUsage.md, llvm/include/llvm/IR IntrinsicsNVVM.td

[NVPTX] Add intrinsics for ff/f16/bf16 to ue5m3 conversions (#218677)

This patch adds the following intrinsics for `ff/f16/bf16` to `ue5m3`
conversions introduced in PTX 9.4:

- `cvt{.rn,.rz,.rp}{.satfinite}.ue5m3x2.f32`
- `cvt{.rn,.rz}{.satfinite}.scaled::n1::ue8m0.ue5m3x2.f32`
- `cvt{.rn,.rz,.rp}{.satfinite}.ue5m3x2{.f16x2,.bf16x2}`
- `cvt{.rn,.rz}{.satfinite}.scaled::n1::ue8m0.ue5m3x2{.f16x2,.bf16x2}`

Tests have been verified through `ptxas-13.4`.

PTX ISA Reference:
https://docs.nvidia.com/cuda/developer-preview/13.4/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt

---------

Signed-off-by: DharuniRAcharya <dharunira at nvidia.com>
DeltaFile
+551-0llvm/test/CodeGen/NVPTX/convert-ue5m3x2.ll
+38-3llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+32-6llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
+23-12llvm/docs/NVPTXUsage.md
+28-0llvm/include/llvm/IR/IntrinsicsNVVM.td
+672-215 files

LLVM/project 96fb2f2mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-target-launch-host.mlir openmp-target-launch-device.mlir

add else block for maxTeamsVals
DeltaFile
+5-3mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+1-1mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+1-1mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+7-53 files

LLVM/project 6f1dcbbmlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-target-launch-device.mlir openmp-target-launch-host.mlir

update
DeltaFile
+30-40mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+24-4mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+20-1mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+74-453 files

LLVM/project 292cdb5mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-target-launch-host.mlir openmp-todo.mlir

[OpenMP][MLIR] Add num_teams mlir to llvm lowering
DeltaFile
+86-38mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+18-2mlir/test/Target/LLVMIR/openmp-todo.mlir
+3-3mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+107-433 files

LLVM/project 2219223llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPTypeUtils.h SLPTypeUtils.cpp

fixup! [SLP][modularisation][NFC] Move full-vector width helpers to SLPTypeUtils (2/2)
DeltaFile
+50-43llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+8-8llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPTypeUtils.cpp
+4-4llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPTypeUtils.h
+62-553 files

LLVM/project 8d0230bflang-rt/lib/runtime unit.cpp, flang-rt/test/Driver endian.f90

flang-rt: improve endian conversion performance (#218302)

Improve endian conversion performance in the flang runtime.

This patch updates the implementation of endian conversion in
flang-rt/lib/runtime/unit.cpp and adds a driver test for endian
conversion handling.

The modified helper functions were not unit-tested directly because
they have internal linkage.

Addresses #208193.
DeltaFile
+93-0flang-rt/test/Driver/endian.f90
+57-0flang-rt/lib/runtime/unit.cpp
+150-02 files

LLVM/project 783b01bllvm/lib/Transforms/Vectorize/SLPVectorizer SLPTypeUtils.h

fixup! [SLP][modularisation][NFC] Move full-vector width helpers to SLPTypeUtils (2/2)
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPTypeUtils.h
+1-11 files