[all-commits] [llvm/llvm-project] d5f532: [mlir][SideEffects] Mark the CFG only terminator o...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Mar 12 14:27:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d5f53253a022f8cdb42e3f1747b42d02492d8815
      https://github.com/llvm/llvm-project/commit/d5f53253a022f8cdb42e3f1747b42d02492d8815
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/include/mlir/Dialect/AffineOps/AffineOps.td
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/include/mlir/Dialect/LoopOps/LoopOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/lib/Transforms/CSE.cpp
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
    M mlir/lib/Transforms/Utils/LoopUtils.cpp

  Log Message:
  -----------
  [mlir][SideEffects] Mark the CFG only terminator operations as NoSideEffect

These terminator operations don't really have any side effects, and this allows for more accurate side-effect analysis for region operations. For example, currently we can't detect like a loop.for or affine.for are dead because the affine.terminator is "side effecting".

Note: Marking as NoSideEffect doesn't mean that these operations can be opaquely erased.

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


  Commit: 483f82b146fe136a6c258f7ca6b7c9cca4c181eb
      https://github.com/llvm/llvm-project/commit/483f82b146fe136a6c258f7ca6b7c9cca4c181eb
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/include/mlir/Dialect/AffineOps/AffineOps.td
    M mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td
    M mlir/include/mlir/Dialect/GPU/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/include/mlir/Dialect/LoopOps/LoopOps.td
    M mlir/include/mlir/Dialect/QuantOps/QuantOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/Dialect/VectorOps/VectorOps.td
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/Interfaces/SideEffects.td
    M mlir/test/lib/TestDialect/TestOps.td
    M mlir/test/mlir-tblgen/op-decl.td
    M mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp

  Log Message:
  -----------
  [mlir][SideEffects][NFC] Move the .td definitions for NoSideEffect/RecursiveSideEffect to SideEffects.td

This matches the location of these traits within the source files.

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


  Commit: 7c211cf3af56be211a36d4f2275b871264117312
      https://github.com/llvm/llvm-project/commit/7c211cf3af56be211a36d4f2275b871264117312
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/AffineOps/AffineOps.h
    M mlir/include/mlir/Dialect/AffineOps/AffineOps.td
    M mlir/lib/Dialect/AffineOps/AffineOps.cpp
    M mlir/test/Dialect/AffineOps/invalid.mlir
    M mlir/test/IR/invalid-ops.mlir

  Log Message:
  -----------
  [mlir][NFC] Move the definition of AffineApplyOp to ODS

This has been a long standing cleanup TODO.

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


  Commit: 907403f342fe661b590f930a83f940c67b3ff855
      https://github.com/llvm/llvm-project/commit/907403f342fe661b590f930a83f940c67b3ff855
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/IR/Matchers.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/lib/IR/Builders.cpp
    M mlir/lib/Transforms/Utils/FoldUtils.cpp
    M mlir/test/Dialect/Linalg/invalid.mlir
    M mlir/test/IR/traits.mlir
    M mlir/test/mlir-tblgen/op-decl.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir] Add a new `ConstantLike` trait to better identify operations that represent a "constant".

The current mechanism for identifying is a bit hacky and extremely adhoc, i.e. we explicit check 1-result, 0-operand, no side-effect, and always foldable and then assume that this is a constant. Adding a trait adds structure to this, and makes checking for a constant much more efficient as we can guarantee that all of these things have already been verified.

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


  Commit: 0ddba0bd59c337f16b51a00cb205ecfda46f97fa
      https://github.com/llvm/llvm-project/commit/0ddba0bd59c337f16b51a00cb205ecfda46f97fa
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/docs/Traits.md
    M mlir/docs/Tutorials/Toy/Ch-2.md
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/Interfaces/SideEffects.h
    M mlir/include/mlir/Interfaces/SideEffects.td
    M mlir/include/mlir/TableGen/SideEffects.h
    M mlir/include/mlir/Transforms/FoldUtils.h
    M mlir/lib/Analysis/Utils.cpp
    M mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
    M mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopFusion.cpp
    M mlir/lib/Interfaces/SideEffects.cpp
    M mlir/lib/TableGen/SideEffects.cpp
    M mlir/lib/Transforms/CSE.cpp
    M mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
    M mlir/lib/Transforms/Utils/FoldUtils.cpp
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
    M mlir/lib/Transforms/Utils/LoopUtils.cpp
    M mlir/lib/Transforms/Utils/RegionUtils.cpp
    M mlir/test/Transforms/canonicalize.mlir
    M mlir/test/mlir-tblgen/op-decl.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.

HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information.

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


  Commit: 396a42d924de7e23a23b576937579f26ff826124
      https://github.com/llvm/llvm-project/commit/396a42d924de7e23a23b576937579f26ff826124
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-03-12 (Thu, 12 Mar 2020)

  Changed paths:
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

  Log Message:
  -----------
  [mlir] Use llvm::ElementCount when constructing an llvm splat vector.

This fixes a breakage after the LLVM API changed.


Compare: https://github.com/llvm/llvm-project/compare/56926a9146fc...396a42d924de


More information about the All-commits mailing list