[all-commits] [llvm/llvm-project] f4e3b8: [mlir][LLVM] Switch `undef` for `poison` for unini...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Thu Feb 6 10:49:52 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4e3b8783cb9eb9a442b14ec8ce7356fa6853387
      https://github.com/llvm/llvm-project/commit/f4e3b8783cb9eb9a442b14ec8ce7356fa6853387
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2025-02-06 (Thu, 06 Feb 2025)

  Changed paths:
    M mlir/include/mlir/Conversion/ComplexToLLVM/ComplexToLLVM.h
    M mlir/include/mlir/Conversion/LLVMCommon/MemRefBuilder.h
    M mlir/include/mlir/Conversion/LLVMCommon/StructBuilder.h
    M mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp
    M mlir/lib/Conversion/ComplexToLLVM/ComplexToLLVM.cpp
    M mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
    M mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
    M mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
    M mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp
    M mlir/lib/Conversion/LLVMCommon/Pattern.cpp
    M mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp
    M mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
    M mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseStorageSpecifierToLLVM.cpp
    M mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir
    M mlir/test/Conversion/ComplexToLLVM/convert-to-llvm.mlir
    M mlir/test/Conversion/ComplexToLLVM/full-conversion.mlir
    M mlir/test/Conversion/FuncToLLVM/calling-convention.mlir
    M mlir/test/Conversion/FuncToLLVM/func-memref-return.mlir
    M mlir/test/Conversion/FuncToLLVM/func-to-llvm.mlir
    M mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
    M mlir/test/Conversion/GPUToLLVMSPV/gpu-to-llvm-spv.mlir
    M mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
    M mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
    M mlir/test/Conversion/GPUToROCDL/gpu-to-rocdl.mlir
    M mlir/test/Conversion/MemRefToLLVM/convert-dynamic-memref-ops.mlir
    M mlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir
    M mlir/test/Conversion/MemRefToLLVM/expand-then-convert-to-llvm.mlir
    M mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir
    M mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    M mlir/test/Dialect/GPU/dynamic-shared-memory.mlir
    M mlir/test/Dialect/LLVM/lower-to-llvm-e2e-with-target-tag.mlir
    M mlir/test/Dialect/LLVM/lower-to-llvm-e2e-with-top-level-named-sequence.mlir
    M mlir/test/Dialect/SparseTensor/specifier_to_llvm.mlir
    M mlir/test/Examples/transform/ChH/full.mlir

  Log Message:
  -----------
  [mlir][LLVM] Switch `undef` for `poison` for uninitialized values (#125629)

LLVM itself is generally moving away from using `undef` and towards
using `poison`, to the point of having a lint that caches new uses of
`undef` in tests.

In order to not trip the lint on new patterns and to conform to the
evolution of LLVM
- Rename valious ::undef() methods on StructBuilder subclasses to
::poison()
- Audit the uses of UndefOp in the MLIR libraries and replace almost all
of them with PoisonOp

The remaining uses of `undef` are initializing `uninitialized` memrefs,
explicit conversions to undef from SPIR-V, and a few cases in
AMDGPUToROCDL where usage like

    %v = insertelement <M x iN> undef, iN %v, i32 0
    %arg = bitcast <M x iN> %v to i(M * N)

is used to handle "i32" arguments that are are really packed vectors of
smaller types that won't always be fully initialized.



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