OSDN Git Service

[Dominators] Take fast path when applying <=1 updates
authorJakub Kuderski <kubakuderski@gmail.com>
Wed, 4 Oct 2017 17:32:55 +0000 (17:32 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Wed, 4 Oct 2017 17:32:55 +0000 (17:32 +0000)
commit90edfc7134ca94cd3aaf4fd79bcc37f2f8e0a04f
tree587a3f0502d55117581c76cf12d0d694c70fa543
parent21b336006c6e956d273b85b8b06cdce1f68f1e7f
[Dominators] Take fast path when applying <=1 updates

Summary:
This patch teaches `DT.applyUpdates` to take the fast when applying zero or just one update and makes it not run the internal batch updater machinery.

With this patch, it should no longer make sense to have a special check in user's code that checks the update sequence size before applying them, e.g.
```
if (!MyUpdates.empty())
  DT.applyUpdates(MyUpdates);
```
or
```
if (MyUpdates.size() == 1)
  if (...)
    DT.insertEdge(...)
  else
    DT.deleteEdge(...)
```

Reviewers: dberlin, brzycki, davide, grosser, sanjoy

Reviewed By: dberlin, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314917 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/GenericDomTree.h
include/llvm/Support/GenericDomTreeConstruction.h