OSDN Git Service

[SimpleLoopUnswitch] Fix DT updates for trivial branch unswitching.
authorAlina Sbirlea <asbirlea@google.com>
Sat, 28 Jul 2018 00:01:05 +0000 (00:01 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Sat, 28 Jul 2018 00:01:05 +0000 (00:01 +0000)
commite593ad899afe88b83eb96cbebbd368dcc48ff125
tree29f5bcd4ed37972569462b8ed5e1e27a7fd3396e
parentbbe055241a28fbaa2b138910852659bb8d9cdcb1
[SimpleLoopUnswitch] Fix DT updates for trivial branch unswitching.

Summary:
Fixing 2 issues with the DT update in trivial branch switching, though I don't have a case where DT update fails.
1. After splitting ParentBB->UnswitchedBB edge, new edges become: ParentBB->LoopExitBB->UnswitchedBB, so remove ParentBB->LoopExitBB edge.
2. AFAIU, for multiple CFG changes, DT should be updated using batch updates, vs consecutive addEdge and removeEdge calls.

Reviewers: chandlerc, kuhar

Subscribers: sanjoy, jlebar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338180 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp