This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Optimize the implementation of RegionDCE
ClosedPublic

Authored by rriddle on Mar 9 2021, 5:51 PM.

Details

Summary

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.

Diff Detail

Event Timeline

rriddle created this revision.Mar 9 2021, 5:51 PM
rriddle requested review of this revision.Mar 9 2021, 5:51 PM
jpienaar accepted this revision.Mar 9 2021, 6:22 PM
jpienaar added inline comments.
mlir/lib/IR/Block.cpp
197

firstDead ?

This revision is now accepted and ready to land.Mar 9 2021, 6:22 PM
This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.