[all-commits] [llvm/llvm-project] ba92da: Revert "Separate the Registration from Loading dia...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Sat Aug 15 01:08:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ba92dadf05c50d53e6bc7345f081e0a5f540b01e
      https://github.com/llvm/llvm-project/commit/ba92dadf05c50d53e6bc7345f081e0a5f540b01e
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2020-08-15 (Sat, 15 Aug 2020)

  Changed paths:
    M flang/unittests/Lower/OpenMPLoweringTest.cpp
    M mlir/examples/standalone/standalone-opt/standalone-opt.cpp
    M mlir/examples/toy/Ch2/toyc.cpp
    M mlir/examples/toy/Ch3/toyc.cpp
    M mlir/examples/toy/Ch4/toyc.cpp
    M mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch5/toyc.cpp
    M mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch6/toyc.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch7/toyc.cpp
    M mlir/include/mlir-c/IR.h
    M mlir/include/mlir/Conversion/Passes.td
    M mlir/include/mlir/Dialect/Affine/Passes.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/Dialect/Linalg/Passes.td
    M mlir/include/mlir/Dialect/SCF/Passes.td
    M mlir/include/mlir/IR/Dialect.h
    M mlir/include/mlir/IR/FunctionSupport.h
    M mlir/include/mlir/IR/MLIRContext.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/InitAllDialects.h
    M mlir/include/mlir/Pass/Pass.h
    M mlir/include/mlir/Pass/PassBase.td
    M mlir/include/mlir/Pass/PassManager.h
    M mlir/include/mlir/Support/MlirOptMain.h
    M mlir/include/mlir/TableGen/Dialect.h
    M mlir/include/mlir/TableGen/Pass.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp
    M mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
    M mlir/lib/Conversion/PassDetail.h
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
    M mlir/lib/Dialect/Affine/Transforms/PassDetail.h
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/PassDetail.h
    M mlir/lib/Dialect/SCF/Transforms/PassDetail.h
    M mlir/lib/Dialect/SDBM/SDBMExpr.cpp
    M mlir/lib/ExecutionEngine/JitRunner.cpp
    M mlir/lib/IR/Dialect.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/Verifier.cpp
    M mlir/lib/Parser/AttributeParser.cpp
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Pass/Pass.cpp
    M mlir/lib/Pass/PassDetail.h
    M mlir/lib/Support/MlirOptMain.cpp
    M mlir/lib/TableGen/Dialect.cpp
    M mlir/lib/TableGen/Pass.cpp
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/lib/Transforms/PassDetail.h
    M mlir/test/CAPI/ir.c
    M mlir/test/EDSC/builder-api-test.cpp
    M mlir/test/SDBM/sdbm-api-test.cpp
    M mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
    M mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/lib/Transforms/TestAllReduceLowering.cpp
    M mlir/test/lib/Transforms/TestBufferPlacement.cpp
    M mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp
    M mlir/test/lib/Transforms/TestLinalgHoisting.cpp
    M mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    M mlir/test/lib/Transforms/TestVectorTransforms.cpp
    M mlir/test/mlir-opt/commandline.mlir
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp
    M mlir/tools/mlir-tblgen/DialectGen.cpp
    M mlir/tools/mlir-tblgen/PassGen.cpp
    M mlir/tools/mlir-translate/mlir-translate.cpp
    M mlir/unittests/Dialect/Quant/QuantizationUtilsTest.cpp
    M mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
    M mlir/unittests/Dialect/SPIRV/SerializationTest.cpp
    M mlir/unittests/IR/AttributeTest.cpp
    M mlir/unittests/IR/DialectTest.cpp
    M mlir/unittests/IR/OperationSupportTest.cpp
    M mlir/unittests/Pass/AnalysisManagerTest.cpp
    M mlir/unittests/SDBM/SDBMTest.cpp
    M mlir/unittests/TableGen/OpBuildGen.cpp
    M mlir/unittests/TableGen/StructsGenTest.cpp

  Log Message:
  -----------
  Revert "Separate the Registration from Loading dialects in the Context"

This was landed by accident, will reland with the right comments
addressed from the reviews.
Also revert dependent build fixes.


  Commit: 20563933875a9396c8ace9c9770ecf6a988c4ea6
      https://github.com/llvm/llvm-project/commit/20563933875a9396c8ace9c9770ecf6a988c4ea6
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2020-08-15 (Sat, 15 Aug 2020)

  Changed paths:
    M flang/unittests/Lower/OpenMPLoweringTest.cpp
    M mlir/examples/standalone/standalone-opt/standalone-opt.cpp
    M mlir/examples/toy/Ch2/toyc.cpp
    M mlir/examples/toy/Ch3/toyc.cpp
    M mlir/examples/toy/Ch4/toyc.cpp
    M mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch5/toyc.cpp
    M mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch6/toyc.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch7/toyc.cpp
    M mlir/include/mlir-c/IR.h
    M mlir/include/mlir/Conversion/Passes.td
    M mlir/include/mlir/Dialect/Affine/Passes.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/Dialect/Linalg/Passes.td
    M mlir/include/mlir/Dialect/SCF/Passes.td
    M mlir/include/mlir/IR/Dialect.h
    M mlir/include/mlir/IR/FunctionSupport.h
    M mlir/include/mlir/IR/MLIRContext.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/InitAllDialects.h
    M mlir/include/mlir/InitAllTranslations.h
    M mlir/include/mlir/Pass/Pass.h
    M mlir/include/mlir/Pass/PassBase.td
    M mlir/include/mlir/Pass/PassManager.h
    M mlir/include/mlir/Support/MlirOptMain.h
    M mlir/include/mlir/TableGen/Dialect.h
    M mlir/include/mlir/TableGen/Pass.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp
    M mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
    M mlir/lib/Conversion/PassDetail.h
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
    M mlir/lib/Dialect/Affine/Transforms/PassDetail.h
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/PassDetail.h
    M mlir/lib/Dialect/SCF/Transforms/PassDetail.h
    M mlir/lib/Dialect/SDBM/SDBMExpr.cpp
    M mlir/lib/ExecutionEngine/JitRunner.cpp
    M mlir/lib/IR/Dialect.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/Verifier.cpp
    M mlir/lib/Parser/AttributeParser.cpp
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Pass/Pass.cpp
    M mlir/lib/Pass/PassDetail.h
    M mlir/lib/Support/MlirOptMain.cpp
    M mlir/lib/TableGen/Dialect.cpp
    M mlir/lib/TableGen/Pass.cpp
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/lib/Transforms/PassDetail.h
    M mlir/test/CAPI/ir.c
    M mlir/test/EDSC/builder-api-test.cpp
    M mlir/test/SDBM/sdbm-api-test.cpp
    M mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
    M mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/lib/Transforms/TestAllReduceLowering.cpp
    M mlir/test/lib/Transforms/TestBufferPlacement.cpp
    M mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp
    M mlir/test/lib/Transforms/TestLinalgHoisting.cpp
    M mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    M mlir/test/lib/Transforms/TestVectorTransforms.cpp
    M mlir/test/mlir-opt/commandline.mlir
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp
    M mlir/tools/mlir-tblgen/DialectGen.cpp
    M mlir/tools/mlir-tblgen/PassGen.cpp
    M mlir/tools/mlir-translate/mlir-translate.cpp
    M mlir/unittests/Dialect/Quant/QuantizationUtilsTest.cpp
    M mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
    M mlir/unittests/Dialect/SPIRV/SerializationTest.cpp
    M mlir/unittests/IR/AttributeTest.cpp
    M mlir/unittests/IR/DialectTest.cpp
    M mlir/unittests/IR/OperationSupportTest.cpp
    M mlir/unittests/Pass/AnalysisManagerTest.cpp
    M mlir/unittests/SDBM/SDBMTest.cpp
    M mlir/unittests/TableGen/OpBuildGen.cpp
    M mlir/unittests/TableGen/StructsGenTest.cpp

  Log Message:
  -----------
  Separate the Registration from Loading dialects in the Context

This changes the behavior of constructing MLIRContext to no longer load globally registered dialects on construction. Instead Dialects are only loaded explicitly on demand:
- the Parser is lazily loading Dialects in the context as it encounters them during parsing. This is the only purpose for registering dialects and not load them in the context.
- Passes are expected to declare the dialects they will create entity from (Operations, Attributes, or Types), and the PassManager is loading Dialects into the Context when starting a pipeline.

This changes simplifies the configuration of the registration: a compiler only need to load the dialect for the IR it will emit, and the optimizer is self-contained and load the required Dialects. For example in the Toy tutorial, the compiler only needs to load the Toy dialect in the Context, all the others (linalg, affine, std, LLVM, ...) are automatically loaded depending on the optimization pipeline enabled.

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


Compare: https://github.com/llvm/llvm-project/compare/3e7403a1346f...20563933875a


More information about the All-commits mailing list