[PATCH] D50308: [WIP!][DomTreeUpdater/Auto[2]] A new Auto UpdateStrategy candidate

Chijun Sima via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 5 07:51:35 PDT 2018


NutshellySima created this revision.
NutshellySima added a reviewer: kuhar.
Herald added subscribers: llvm-commits, mgrang, JDevlieghere.

> This patch is a work-in-process and I don't intend to commit it. If you are automatically subscribed to this patch, please ignore it.

This patch is an approach to solve the problems in the current `DomTreeUpdater` and `JumpThreading` pass. (We need to figure out the previous state of the CFG when we call `applyUpdates()/insertEdge()/deleteEdge()` or we need to concern about the internal state of the `DomTreeUpdater`). It shows a similar performance most of the times on bitcode files with the current `DomTreeUpdater` working under Lazy UpdateStrategy after converting `CorrelatedValuePropagation/RewriteStatepointsForGC/JumpThreading` and testing under the `-O3` pipeline. But it also suffers a performance degradation sometimes which is caused by 1. the `LazyValueInfo` relies on whether the `DominatorTree` is up to date to perform queries and the new Auto UpdateStrategy reports up-to-date less than the Lazy UpdateStrategy (this issue needs to inspect further); 2. some Function contains a lot of BasicBlock which causes snapshotting really slow. (we can use some other compilers like rustc which emits a lot of BasicBlocks to test it).

This patch implements the Auto UpdateStrategy by getting a full snapshot the first time `DomTreeUpdater` is initialized. Then use the information submitted by users (especially the From points) to avoid full snapshot later. Because the `JumpThreading` pass always calls `DTU.recalculate(F)` deep in the `MergeBasicBlockIntoOnlyPred` in `Local.cpp`, so though this implementation is theoretically faster than https://reviews.llvm.org/D50302, the result of benchmark don't show great difference.


Repository:
  rL LLVM

https://reviews.llvm.org/D50308

Files:
  include/llvm/IR/DomTreeUpdater.h
  lib/IR/DomTreeUpdater.cpp
  unittests/IR/DomTreeUpdaterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50308.159210.patch
Type: text/x-patch
Size: 13316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180805/ba36fb95/attachment.bin>


More information about the llvm-commits mailing list