[all-commits] [llvm/llvm-project] 92567d: [mlir] Add Dead Code Analysis

Jeff Niu via All-commits all-commits at lists.llvm.org
Wed Jun 29 10:22:10 PDT 2022


  Branch: refs/heads/multi
  Home:   https://github.com/llvm/llvm-project
  Commit: 92567dff07792249ec3ac41f9c9a1dca51d7ef83
      https://github.com/llvm/llvm-project/commit/92567dff07792249ec3ac41f9c9a1dca51d7ef83
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/DataFlowAnalysis.h
    M mlir/include/mlir/Analysis/DataFlowFramework.h
    A mlir/include/mlir/Analysis/SparseDataFlowAnalysis.h
    M mlir/lib/Analysis/CMakeLists.txt
    A mlir/lib/Analysis/SparseDataFlowAnalysis.cpp
    A mlir/test/Analysis/test-dead-code-analysis.mlir
    M mlir/test/lib/Analysis/CMakeLists.txt
    A mlir/test/lib/Analysis/TestDeadCodeAnalysis.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Add Dead Code Analysis

This patch implements the analysis state classes needed for sparse data-flow analysis and implements a dead-code analysis using those states to determine liveness of blocks, control-flow edges, region predecessors, and function callsites.


  Commit: 086836c794cc26f1070014003204c63fb3810702
      https://github.com/llvm/llvm-project/commit/086836c794cc26f1070014003204c63fb3810702
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/SparseDataFlowAnalysis.h
    M mlir/lib/Analysis/SparseDataFlowAnalysis.cpp
    M mlir/lib/Transforms/SCCP.cpp

  Log Message:
  -----------
  [mlir] An implementation of sparse data-flow analysis

This patch introduces a (forward) sparse data-flow analysis implemented with the data-flow analysis framework. The analysis interacts with liveness information that can be provided by dead-code analysis to be conditional. This patch re-implements SCCP using dead-code analysis and (conditional) constant propagation analyses.


  Commit: ef55eb3d7410b86eac8e796adcb1dc1b258baa45
      https://github.com/llvm/llvm-project/commit/ef55eb3d7410b86eac8e796adcb1dc1b258baa45
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    A mlir/include/mlir/Analysis/DenseDataFlowAnalysis.h
    M mlir/include/mlir/Analysis/SparseDataFlowAnalysis.h
    M mlir/lib/Analysis/CMakeLists.txt
    A mlir/lib/Analysis/DenseDataFlowAnalysis.cpp
    A mlir/test/Analysis/test-last-modified-callgraph.mlir
    A mlir/test/Analysis/test-last-modified.mlir
    M mlir/test/lib/Analysis/CMakeLists.txt
    A mlir/test/lib/Analysis/TestDenseDataFlowAnalysis.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] An implementation of dense data-flow analysis

This patch introduces an implementation of dense data-flow analysis. Dense
data-flow analysis attaches a lattice before and after the execution of every
operation. The lattice state is propagated across operations by a user-defined
transfer function. The state is joined across control-flow and callgraph edges.

Thge patch provides an example pass that uses both a dense and a sparse analysis
together.


  Commit: a14f85985c9f009c4d051f82d92842589ebb2b1b
      https://github.com/llvm/llvm-project/commit/a14f85985c9f009c4d051f82d92842589ebb2b1b
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/DataFlowFramework.h
    M mlir/include/mlir/Analysis/IntRangeAnalysis.h
    M mlir/include/mlir/Analysis/SparseDataFlowAnalysis.h
    M mlir/include/mlir/Interfaces/InferIntRangeInterface.td
    M mlir/lib/Analysis/DataFlowFramework.cpp
    M mlir/lib/Analysis/IntRangeAnalysis.cpp
    M mlir/lib/Analysis/SparseDataFlowAnalysis.cpp
    M mlir/lib/Dialect/Arithmetic/Transforms/UnsignedWhenEquivalent.cpp
    M mlir/lib/Transforms/SCCP.cpp
    M mlir/test/lib/Analysis/TestDeadCodeAnalysis.cpp
    M mlir/test/lib/Transforms/TestIntRangeInference.cpp

  Log Message:
  -----------
  [mlir] Swap integer range inference to the new framework

Integer range inference has been swapped to the new framework. The integer value range lattices automatically updates the corresponding constant value on update.


  Commit: 039c1aaa1d8c24c51b10d9f1ccee0b30fd3303a9
      https://github.com/llvm/llvm-project/commit/039c1aaa1d8c24c51b10d9f1ccee0b30fd3303a9
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/DataFlowAnalysis.h
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Analysis/DataFlowAnalysis.cpp
    M mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
    M mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp
    R mlir/test/Analysis/test-data-flow.mlir
    M mlir/test/lib/Analysis/CMakeLists.txt
    R mlir/test/lib/Analysis/TestDataFlow.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Delete ForwardDataFlowAnalysis

With SCCP and integer range analysis ported to the new framework, this old framework is redundant. Delete it.


  Commit: bcb16b6247cb60e295c53f2a8a3caa02c5ab8ac9
      https://github.com/llvm/llvm-project/commit/bcb16b6247cb60e295c53f2a8a3caa02c5ab8ac9
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/DataFlowFramework.h
    M mlir/include/mlir/Analysis/DenseDataFlowAnalysis.h
    M mlir/include/mlir/Analysis/IntRangeAnalysis.h
    M mlir/include/mlir/Analysis/SparseDataFlowAnalysis.h
    M mlir/lib/Analysis/DataFlowFramework.cpp
    M mlir/lib/Analysis/DenseDataFlowAnalysis.cpp
    M mlir/lib/Analysis/IntRangeAnalysis.cpp
    M mlir/lib/Analysis/SparseDataFlowAnalysis.cpp
    M mlir/lib/Dialect/Arithmetic/Transforms/UnsignedWhenEquivalent.cpp
    M mlir/lib/Transforms/SCCP.cpp
    M mlir/test/lib/Analysis/TestDataFlowFramework.cpp
    M mlir/test/lib/Analysis/TestDeadCodeAnalysis.cpp
    M mlir/test/lib/Analysis/TestDenseDataFlowAnalysis.cpp
    M mlir/test/lib/Transforms/TestIntRangeInference.cpp

  Log Message:
  -----------
  overhaul state management and allow multi state elements


  Commit: a2abbc2ec1b00a45e446a9a19ac65868ac9ea8d1
      https://github.com/llvm/llvm-project/commit/a2abbc2ec1b00a45e446a9a19ac65868ac9ea8d1
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M mlir/test/lib/Analysis/TestDataFlowFramework.cpp

  Log Message:
  -----------
  test composition


Compare: https://github.com/llvm/llvm-project/compare/92567dff0779%5E...a2abbc2ec1b0


More information about the All-commits mailing list