[PATCH] D50173: [Dominators] Refine the logic of recalculate() in the DomTreeUpdater

Chijun Sima via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 02:17:56 PDT 2018


NutshellySima created this revision.
NutshellySima added reviewers: kuhar, dmgreen, brzycki, grosser, davide.
Herald added a subscriber: llvm-commits.

This patch refines the logic of `recalculate()` in the `DomTreeUpdater` in the following two aspects:

1. Previously, `recalculate()` tests whether there are pending updates/BBs awaiting deletion and then do recalculation under Lazy UpdateStrategy; and do recalculation immediately under Eager UpdateStrategy. (The former behavior is inherited from the `DeferredDominance` class). This is an inconsistency between two strategies and there is no obvious reason to do this. So the behavior is changed to always recalculate available trees when calling `recalculate()`.
2. Fix the issue of when DTU under Lazy UpdateStrategy holds nothing but with BBs awaiting deletion, after calling `recalculate()`, BBs awaiting deletion aren't flushed. An additional unittest is added to cover this case.


Repository:
  rL LLVM

https://reviews.llvm.org/D50173

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50173.158705.patch
Type: text/x-patch
Size: 3727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180802/675688dd/attachment.bin>


More information about the llvm-commits mailing list