[all-commits] [llvm/llvm-project] a6d09d: Add a `-verify-roundtrip` option to `mlir-opt` int...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu May 25 15:16:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6d09d4b1ac224ed90ee8ff6c964a2bff39421c7
      https://github.com/llvm/llvm-project/commit/a6d09d4b1ac224ed90ee8ff6c964a2bff39421c7
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
    M mlir/test/lit.cfg.py

  Log Message:
  -----------
  Add a `-verify-roundtrip` option to `mlir-opt` intended to validate custom printer/parser completeness

Running:

  MLIR_OPT_CHECK_IR_ROUNDTRIP=1 ninja check-mlir

will now exercises all of our test with a round-trip to bytecode and a comparison for equality.

Reviewed By: rriddle, ftynse, jpienaar

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


  Commit: 837d1ce0dc8eec5b17255291b3462e6296cb369b
      https://github.com/llvm/llvm-project/commit/837d1ce0dc8eec5b17255291b3462e6296cb369b
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M mlir/examples/standalone/include/Standalone/StandaloneDialect.h
    M mlir/include/mlir/Bytecode/BytecodeImplementation.h
    A mlir/include/mlir/Bytecode/BytecodeOpInterface.h
    A mlir/include/mlir/Bytecode/BytecodeOpInterface.td
    M mlir/include/mlir/Bytecode/BytecodeWriter.h
    A mlir/include/mlir/Bytecode/CMakeLists.txt
    M mlir/include/mlir/Bytecode/Encoding.h
    M mlir/include/mlir/CMakeLists.txt
    M mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h
    M mlir/include/mlir/Dialect/AMX/AMXDialect.h
    M mlir/include/mlir/Dialect/Affine/TransformOps/AffineTransformOps.h
    M mlir/include/mlir/Dialect/Arith/IR/Arith.h
    M mlir/include/mlir/Dialect/ArmNeon/ArmNeonDialect.h
    M mlir/include/mlir/Dialect/ArmSVE/ArmSVEDialect.h
    M mlir/include/mlir/Dialect/Async/IR/Async.h
    M mlir/include/mlir/Dialect/Bufferization/IR/Bufferization.h
    M mlir/include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.h
    M mlir/include/mlir/Dialect/Complex/IR/Complex.h
    M mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlow.h
    M mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.h
    M mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.h
    M mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
    M mlir/include/mlir/Dialect/IRDL/IR/IRDL.h
    M mlir/include/mlir/Dialect/Index/IR/IndexOps.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h
    M mlir/include/mlir/Dialect/Linalg/IR/Linalg.h
    M mlir/include/mlir/Dialect/MLProgram/IR/MLProgram.h
    M mlir/include/mlir/Dialect/Math/IR/Math.h
    M mlir/include/mlir/Dialect/MemRef/IR/MemRef.h
    M mlir/include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.h
    M mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
    M mlir/include/mlir/Dialect/OpenACC/OpenACC.h
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.h
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterp.h
    M mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.h
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
    M mlir/include/mlir/Dialect/Shape/IR/Shape.h
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
    M mlir/include/mlir/Dialect/Tensor/IR/Tensor.h
    M mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.h
    M mlir/include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.h
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.h
    M mlir/include/mlir/Dialect/X86Vector/X86VectorDialect.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/TableGen/Property.h
    A mlir/lib/Bytecode/BytecodeOpInterface.cpp
    M mlir/lib/Bytecode/CMakeLists.txt
    M mlir/lib/Bytecode/Reader/BytecodeReader.cpp
    M mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
    M mlir/lib/Bytecode/Writer/CMakeLists.txt
    M mlir/lib/Bytecode/Writer/IRNumbering.cpp
    M mlir/lib/Bytecode/Writer/IRNumbering.h
    M mlir/lib/TableGen/Property.cpp
    M mlir/test/Bytecode/invalid/invalid-structure.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.h
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [MLIR] Add native Bytecode support for properties

This is adding a new interface (`BytecodeOpInterface`) to allow operations to
opt-in skipping conversion to attribute and serializing properties to native
bytecode.

The scheme relies on a new section where properties are stored in sequence

  { size, serialize_properties }, ...

The operations are storing the index of a properties, a table of offset is
built when loading the properties section the first time.

Back-deployment to version prior to 4 are relying on getAttrDictionnary() which
we intend to deprecate and remove: that is putting a de-factor end-of-support
horizon for supporting deployments to version older than 4.

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


Compare: https://github.com/llvm/llvm-project/compare/7c847ac4bd1b...837d1ce0dc8e


More information about the All-commits mailing list