[all-commits] [llvm/llvm-project] 2230bf: [mlir] replace LLVMIntegerType with built-in integ...

ftynse via All-commits all-commits at lists.llvm.org
Thu Jan 7 10:52:55 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2230bf99c712a1e9cb3a9f423998aa8727b389fc
      https://github.com/llvm/llvm-project/commit/2230bf99c712a1e9cb3a9f423998aa8727b389fc
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-01-07 (Thu, 07 Jan 2021)

  Changed paths:
    M mlir/docs/ConversionToLLVMDialect.md
    M mlir/docs/Dialects/LLVM.md
    M mlir/docs/LLVMDialectMemRefConvention.md
    M mlir/docs/SPIRVToLLVMDialectConversion.md
    M mlir/docs/Tutorials/Toy/Ch-6.md
    M mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
    M mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/integration_test/Dialect/LLVMIR/CPU/X86/test-inline-asm.mlir
    M mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir
    M mlir/integration_test/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir
    M mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
    M mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
    M mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
    M mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
    M mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
    M mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
    M mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h
    M mlir/lib/ExecutionEngine/JitRunner.cpp
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M mlir/lib/Target/LLVMIR/TypeTranslation.cpp
    M mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir
    M mlir/test/Conversion/GPUCommon/memory-attrbution.mlir
    M mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
    M mlir/test/Conversion/GPUToROCDL/gpu-to-rocdl.mlir
    M mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir
    M mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
    M mlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/bitwise-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/comparison-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/constant-op-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/func-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/glsl-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/logical-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls.mlir
    M mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
    M mlir/test/Conversion/SPIRVToLLVM/shift-ops-to-llvm.mlir
    M mlir/test/Conversion/StandardToLLVM/calling-convention.mlir
    M mlir/test/Conversion/StandardToLLVM/convert-argattrs.mlir
    M mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir
    M mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir
    M mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir
    M mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
    M mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    M mlir/test/Dialect/GPU/outlining.mlir
    M mlir/test/Dialect/LLVMIR/dialect-cast.mlir
    M mlir/test/Dialect/LLVMIR/func.mlir
    M mlir/test/Dialect/LLVMIR/global.mlir
    M mlir/test/Dialect/LLVMIR/invalid.mlir
    M mlir/test/Dialect/LLVMIR/legalize-for-export.mlir
    M mlir/test/Dialect/LLVMIR/nvvm.mlir
    M mlir/test/Dialect/LLVMIR/rocdl.mlir
    M mlir/test/Dialect/LLVMIR/roundtrip.mlir
    M mlir/test/Dialect/LLVMIR/terminator.mlir
    M mlir/test/Dialect/LLVMIR/types-invalid.mlir
    M mlir/test/Dialect/LLVMIR/types.mlir
    M mlir/test/Dialect/Linalg/llvm.mlir
    M mlir/test/Dialect/OpenMP/ops.mlir
    M mlir/test/Dialect/SPIRV/IR/types.mlir
    M mlir/test/Target/arm-sve.mlir
    M mlir/test/Target/avx512.mlir
    M mlir/test/Target/import.ll
    M mlir/test/Target/llvmir-intrinsics.mlir
    M mlir/test/Target/llvmir-types.mlir
    M mlir/test/Target/llvmir.mlir
    M mlir/test/Target/nvvmir.mlir
    M mlir/test/Target/openmp-llvm.mlir
    M mlir/test/Target/rocdl.mlir
    M mlir/test/Transforms/test-convert-call-op.mlir
    M mlir/test/lib/Transforms/TestConvertCallOp.cpp
    M mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir
    M mlir/test/mlir-cpu-runner/simple.mlir

  Log Message:
  -----------
  [mlir] replace LLVMIntegerType with built-in integer type

The LLVM dialect type system has been closed until now, i.e. did not support
types from other dialects inside containers. While this has had obvious
benefits of deriving from a common base class, it has led to some simple types
being almost identical with the built-in types, namely integer and floating
point types. This in turn has led to a lot of larger-scale complexity: simple
types must still be converted, numerous operations that correspond to LLVM IR
intrinsics are replicated to produce versions operating on either LLVM dialect
or built-in types leading to quasi-duplicate dialects, lowering to the LLVM
dialect is essentially required to be one-shot because of type conversion, etc.
In this light, it is reasonable to trade off some local complexity in the
internal implementation of LLVM dialect types for removing larger-scale system
complexity. Previous commits to the LLVM dialect type system have adapted the
API to support types from other dialects.

Replace LLVMIntegerType with the built-in IntegerType plus additional checks
that such types are signless (these are isolated in a utility function that
replaced `isa<LLVMType>` and in the parser). Temporarily keep the possibility
to parse `!llvm.i32` as a synonym for `i32`, but add a deprecation notice.

Reviewed By: mehdi_amini, silvas, antiagainst

Differential Revision: https://reviews.llvm.org/D94178




More information about the All-commits mailing list