[all-commits] [llvm/llvm-project] 4e02eb: [mlir] Optimize the implementation of RegionDCE

River Riddle via All-commits all-commits at lists.llvm.org
Wed Mar 10 16:45:53 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e02eb8014c4dd8dd21071947525926bbe8046ef
      https://github.com/llvm/llvm-project/commit/4e02eb8014c4dd8dd21071947525926bbe8046ef
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-03-10 (Wed, 10 Mar 2021)

  Changed paths:
    M mlir/include/mlir/IR/Block.h
    M mlir/lib/IR/Block.cpp
    M mlir/lib/Transforms/Utils/RegionUtils.cpp

  Log Message:
  -----------
  [mlir] Optimize the implementation of RegionDCE

The current implementation has some inefficiencies that become noticeable when running on large modules. This revision optimizes the code, and updates some out-dated idioms with newer utilities. The main components of this optimization include:

* Add an overload of Block::eraseArguments that allows for O(N) erasure of disjoint arguments.
* Don't process entry block arguments given that we don't erase them at this point.
* Don't track individual operation results, given that we don't erase them. We can just track the parent operation.

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




More information about the All-commits mailing list