[all-commits] [llvm/llvm-project] 4d67b2: [mlir] Add operations to BlockAndValueMapping and ...

Jeff Niu via All-commits all-commits at lists.llvm.org
Thu Jan 12 13:16:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d67b278173167caa0f06f3ec6cdd36f2549a952
      https://github.com/llvm/llvm-project/commit/4d67b278173167caa0f06f3ec6cdd36f2549a952
  Author: Jeff Niu <jeff at modular.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIRDialect.h
    M flang/include/flang/Optimizer/Transforms/Passes.h
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/lib/Optimizer/Dialect/FIRDialect.cpp
    M flang/lib/Optimizer/Dialect/Inliner.cpp
    M mlir/docs/Interfaces.md
    M mlir/docs/Rationale/UsageOfConst.md
    M mlir/docs/Tutorials/Toy/Ch-4.md
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
    R mlir/include/mlir/IR/BlockAndValueMapping.h
    M mlir/include/mlir/IR/Builders.h
    A mlir/include/mlir/IR/IRMapping.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/IR/Region.h
    M mlir/include/mlir/Interfaces/DestinationStyleOpInterface.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/include/mlir/Transforms/InliningUtils.h
    M mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
    M mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
    M mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
    M mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
    M mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp
    M mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
    M mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
    M mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
    M mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
    M mlir/lib/Dialect/Affine/Utils/LoopFusionUtils.cpp
    M mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
    M mlir/lib/Dialect/Affine/Utils/Utils.cpp
    M mlir/lib/Dialect/Arith/IR/ArithDialect.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
    M mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
    M mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp
    M mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
    M mlir/lib/Dialect/Func/IR/FuncOps.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
    M mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp
    M mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp
    M mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgDialect.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
    M mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
    M mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    M mlir/lib/Dialect/Math/IR/MathDialect.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp
    M mlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp
    M mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
    M mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
    M mlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
    M mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
    M mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
    M mlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
    M mlir/lib/IR/Builders.cpp
    M mlir/lib/IR/BuiltinDialect.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/IR/Region.cpp
    M mlir/lib/Reducer/ReductionNode.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/lib/Transforms/Utils/InliningUtils.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/IR/TestClone.cpp
    M mlir/test/lib/IR/TestSlicing.cpp
    M mlir/test/lib/Transforms/TestInlining.cpp
    R mlir/unittests/IR/BlockAndValueMapping.cpp
    M mlir/unittests/IR/CMakeLists.txt
    A mlir/unittests/IR/IRMapping.cpp

  Log Message:
  -----------
  [mlir] Add operations to BlockAndValueMapping and rename it to IRMapping

The patch adds operations to `BlockAndValueMapping` and renames it to `IRMapping`. When operations are cloned, old operations are mapped to the cloned operations. This allows mapping from an operation to a cloned operation. Example:

```
Operation *opWithRegion = ...
Operation *opInsideRegion = &opWithRegion->front().front();

IRMapping map
Operation *newOpWithRegion = opWithRegion->clone(map);
Operation *newOpInsideRegion = map.lookupOrNull(opInsideRegion);
```

Migration instructions:
All includes to `mlir/IR/BlockAndValueMapping.h` should be replaced with `mlir/IR/IRMapping.h`. All uses of `BlockAndValueMapping` need to be renamed to `IRMapping`.

Reviewed By: rriddle, mehdi_amini

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




More information about the All-commits mailing list