OSDN Git Service

[JumpThreading] Preservation of DT and LVI across the pass
authorBrian M. Rzycki <brzycki@gmail.com>
Fri, 12 Jan 2018 21:06:48 +0000 (21:06 +0000)
committerBrian M. Rzycki <brzycki@gmail.com>
Fri, 12 Jan 2018 21:06:48 +0000 (21:06 +0000)
commita57b9dfaee5a3485318bf0d1785e0a2e81310f01
tree7d6d47f94543dad29e031617fee411e422b3759a
parente2b0a2aafa1af7ae8afe005e9c1e2c331e332160
[JumpThreading] Preservation of DT and LVI across the pass

Summary:
See D37528 for a previous (non-deferred) version of this
patch and its description.

Preserves dominance in a deferred manner using a new class
DeferredDominance. This reduces the performance impact of
updating the DominatorTree at every edge insertion and
deletion. A user may call DDT->flush() within JumpThreading
for an up-to-date DT. This patch currently has one flush()
at the end of runImpl() to ensure DT is preserved across
the pass.

LVI is also preserved to help subsequent passes such as
CorrelatedValuePropagation. LVI is simpler to maintain and
is done immediately (not deferred). The code to perform the
preversation was minimally altered and simply marked as
preserved for the PassManager to be informed.

This extends the analysis available to JumpThreading for
future enhancements such as threading across loop headers.

Reviewers: dberlin, kuhar, sebpop

Reviewed By: kuhar, sebpop

Subscribers: mgorny, dmgreen, kuba, rnk, rsmith, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322401 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/llvm/IR/Dominators.h
include/llvm/Transforms/Scalar/JumpThreading.h
include/llvm/Transforms/Utils/BasicBlockUtils.h
include/llvm/Transforms/Utils/Local.h
lib/IR/Dominators.cpp
lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
lib/Transforms/Scalar/JumpThreading.cpp
lib/Transforms/Utils/BasicBlockUtils.cpp
lib/Transforms/Utils/Local.cpp
test/Analysis/LazyValueAnalysis/lvi-after-jumpthreading.ll
test/Transforms/JumpThreading/ddt-crash.ll [new file with mode: 0644]
test/Transforms/JumpThreading/ddt-crash2.ll [new file with mode: 0644]
test/Transforms/JumpThreading/lvi-tristate.ll [new file with mode: 0644]
unittests/IR/CMakeLists.txt
unittests/IR/DeferredDominanceTest.cpp [new file with mode: 0644]