[all-commits] [llvm/llvm-project] 6c867e: [mlir] Use `getSingleElement`/`hasSingleElement` i...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sun Mar 16 23:43:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c867e27a7b597910571677abdef77b703a5a601
      https://github.com/llvm/llvm-project/commit/6c867e27a7b597910571677abdef77b703a5a601
  Author: Matthias Springer <me at m-sp.org>
  Date:   2025-03-17 (Mon, 17 Mar 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/CommonFolders.h
    M mlir/lib/Analysis/SliceAnalysis.cpp
    M mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp
    M mlir/lib/Conversion/GPUToSPIRV/WmmaOpsToSPIRV.cpp
    M mlir/lib/Conversion/MeshToMPI/MeshToMPI.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
    M mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
    M mlir/lib/Dialect/Linalg/Transforms/SubsetInsertionOpInterfaceImpl.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/Quant/Transforms/StripFuncQuantTypes.cpp
    M mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/lib/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseIterationToScf.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
    M mlir/test/lib/Analysis/TestCFGLoopInfo.cpp

  Log Message:
  -----------
  [mlir] Use `getSingleElement`/`hasSingleElement` in various places (#131460)

This is a code cleanup. Update a few places in MLIR that should use
`hasSingleElement`/`getSingleElement`.

Note: `hasSingleElement` is faster than `.getSize() == 1` when it is
used with linked lists etc.

Depends on #131508.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list