[all-commits] [llvm/llvm-project] cd4ca2: [mlir] Port Conversion Passes to LLVM to use Table...

zero9178 via All-commits all-commits at lists.llvm.org
Fri Feb 10 11:55:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd4ca2d7f991177b64db9df3c17986dc8e250f1d
      https://github.com/llvm/llvm-project/commit/cd4ca2d7f991177b64db9df3c17986dc8e250f1d
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M mlir/include/mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h
    M mlir/include/mlir/Conversion/ComplexToLLVM/ComplexToLLVM.h
    M mlir/include/mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h
    M mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
    M mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h
    M mlir/include/mlir/Conversion/MathToLLVM/MathToLLVM.h
    M mlir/include/mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h
    M mlir/include/mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h
    M mlir/include/mlir/Conversion/Passes.td
    M mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h
    M mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h
    M mlir/include/mlir/Dialect/GPU/Transforms/Passes.h
    M mlir/include/mlir/Dialect/GPU/Transforms/Utils.h
    M mlir/include/mlir/Dialect/SparseTensor/Pipelines/Passes.h
    M mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
    M mlir/lib/Conversion/ComplexToLLVM/ComplexToLLVM.cpp
    M mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp
    M mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
    M mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
    M mlir/lib/Conversion/MathToLLVM/MathToLLVM.cpp
    M mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp
    M mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.cpp
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp
    M mlir/test/lib/Dialect/LLVM/TestLowerToLLVM.cpp

  Log Message:
  -----------
  [mlir] Port Conversion Passes to LLVM to use TableGen generated constructors and options

See https://github.com/llvm/llvm-project/issues/57475 for more context.

Using auto-generated constructors and options has significant advantages:
* It forces a uniform style and expectation for consuming a pass
* It allows to very easily add, remove or change options to a pass by simply making the changes in TableGen
* Its less code

This patch in particular ports all the conversion passes which lower to LLVM to use the auto generated constructors and options. For the most part, care was taken so that auto generated constructor functions have the same name as they previously did. Only following slight breaking changes (which I consider as worth the churn) have been made:
* `mlir::cf::createConvertControlFlowToLLVMPass` has been moved to the `mlir` namespace. This is consistent with basically all conversion passes
* `createGpuToLLVMConversionPass` now takes a proper options struct array for its pass options. The pass options are now also autogenerated.
* `LowerVectorToLLVMOptions` has been replaced by the autogenerated `ConvertVectorToLLVMPassOptions` which is automatically kept up to date by TableGen
* I had to move one function in the GPU to LLVM lowering as it is used as default value for an option.
* All passes that previously returned `unique_ptr<OperationPass<...>>` now simply return `unique_ptr<Pass>`

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




More information about the All-commits mailing list